]> Gentwo Git Trees - linux/.git/commitdiff
fbdev: mb862xxfb: Use int type to store negative error codes
authorQianfeng Rong <rongqianfeng@vivo.com>
Sat, 30 Aug 2025 12:47:00 +0000 (20:47 +0800)
committerHelge Deller <deller@gmx.de>
Tue, 30 Sep 2025 21:21:34 +0000 (23:21 +0200)
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>
drivers/video/fbdev/mb862xx/mb862xxfbdrv.c

index ade88e7bc7607f78bb9972b0286b73119c00682f..676c6d3ccc12026ed2db741b07a90a573f1a0e02 100644 (file)
@@ -674,7 +674,7 @@ static int of_platform_mb862xx_probe(struct platform_device *ofdev)
        struct fb_info *info;
        struct resource res;
        resource_size_t res_size;
-       unsigned long ret = -ENODEV;
+       int ret = -ENODEV;
 
        if (of_address_to_resource(np, 0, &res)) {
                dev_err(dev, "Invalid address\n");