Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: mb862xxfb: Use int type to store negative error codes

Change the 'ret' variable in of_platform_mb862xx_probe() from unsigned long
to int, as it needs to store either negative error codes or zero.

Storing the negative error codes in unsigned type, doesn't cause an issue
at runtime but can be confusing. Additionally, assigning negative error
codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
flag is enabled.

No effect on runtime.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Qianfeng Rong and committed by
Helge Deller
4d23d9f7 c7d655ef

+1 -1
+1 -1
drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
··· 674 674 struct fb_info *info; 675 675 struct resource res; 676 676 resource_size_t res_size; 677 - unsigned long ret = -ENODEV; 677 + int ret = -ENODEV; 678 678 679 679 if (of_address_to_resource(np, 0, &res)) { 680 680 dev_err(dev, "Invalid address\n");