* [PATCH] gpio: remove useless check in gpiolib_sysfs_init()
@ 2014-07-23 14:56 Alexandre Courbot
2014-07-24 14:04 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Courbot @ 2014-07-23 14:56 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio, linux-kernel, Alexandre Courbot
An iterator variable cannot be NULL in its loop.
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/gpio/gpiolib-sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index 3516502..bcc0ec0 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -814,7 +814,7 @@ static int __init gpiolib_sysfs_init(void)
*/
spin_lock_irqsave(&gpio_lock, flags);
list_for_each_entry(chip, &gpio_chips, list) {
- if (!chip || chip->exported)
+ if (chip->exported)
continue;
spin_unlock_irqrestore(&gpio_lock, flags);
--
2.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpio: remove useless check in gpiolib_sysfs_init()
2014-07-23 14:56 [PATCH] gpio: remove useless check in gpiolib_sysfs_init() Alexandre Courbot
@ 2014-07-24 14:04 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2014-07-24 14:04 UTC (permalink / raw)
To: Alexandre Courbot; +Cc: linux-gpio, linux-kernel
On Wed, Jul 23, 2014 at 4:56 PM, Alexandre Courbot <acourbot@nvidia.com> wrote:
> An iterator variable cannot be NULL in its loop.
>
> Reported-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-24 14:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23 14:56 [PATCH] gpio: remove useless check in gpiolib_sysfs_init() Alexandre Courbot
2014-07-24 14:04 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).