]> git.baikalelectronics.ru Git - kernel.git/commitdiff
gpio: mpc8xxx: Fix an ignored error return from platform_get_irq()
authorYang Li <yang.lee@linux.alibaba.com>
Wed, 19 Jan 2022 01:04:32 +0000 (09:04 +0800)
committerBartosz Golaszewski <brgl@bgdev.pl>
Thu, 20 Jan 2022 08:05:57 +0000 (09:05 +0100)
The return from the call to platform_get_irq() is int, it can be
a negative error code, however this is being assigned to an unsigned
int variable 'irqn', so making 'irqn' an int.

Eliminate the following coccicheck warning:
./drivers/gpio/gpio-mpc8xxx.c:391:5-21: WARNING: Unsigned expression
compared with zero: mpc8xxx_gc -> irqn < 0

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: 2b10b8665107 ("gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe")
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
drivers/gpio/gpio-mpc8xxx.c

index 01634c8d27b387f40c79f5d20c9df14296bebef2..a964e25ea620611f8302d5f4b7b78053087cdf02 100644 (file)
@@ -47,7 +47,7 @@ struct mpc8xxx_gpio_chip {
                                unsigned offset, int value);
 
        struct irq_domain *irq;
-       unsigned int irqn;
+       int irqn;
 };
 
 /*