gpiolib: Fix a WARN_ON that can never trigger
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 27 Jan 2017 11:56:42 +0000 (12:56 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 31 Jan 2017 14:44:16 +0000 (15:44 +0100)
"if (!x) WARN_ON(x)" can never trigger.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c

index 18a173fc4a213f4d58a010da934a3fad95639408..385df5241e5d3ac12b9d18fa3374a0cfe9b73250 100644 (file)
@@ -1422,8 +1422,7 @@ void devm_gpiochip_remove(struct device *dev, struct gpio_chip *chip)
 
        ret = devres_release(dev, devm_gpio_chip_release,
                             devm_gpio_chip_match, chip);
-       if (!ret)
-               WARN_ON(ret);
+       WARN_ON(ret);
 }
 EXPORT_SYMBOL_GPL(devm_gpiochip_remove);