linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpiolib: Fix a WARN_ON that can never trigger
@ 2017-01-27 11:56 Christophe JAILLET
  2017-01-31 14:44 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2017-01-27 11:56 UTC (permalink / raw)
  To: linus.walleij, gnurou
  Cc: linux-gpio, linux-kernel, kernel-janitors, Christophe JAILLET

"if (!x) WARN_ON(x)" can never trigger.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/gpio/gpiolib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 59d3d960ccd4..1e8bda36b73e 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -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);
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpiolib: Fix a WARN_ON that can never trigger
  2017-01-27 11:56 [PATCH] gpiolib: Fix a WARN_ON that can never trigger Christophe JAILLET
@ 2017-01-31 14:44 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2017-01-31 14:44 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Alexandre Courbot, linux-gpio, linux-kernel, kernel-janitors

On Fri, Jan 27, 2017 at 12:56 PM, Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:

> "if (!x) WARN_ON(x)" can never trigger.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Good catch.

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-31 14:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-27 11:56 [PATCH] gpiolib: Fix a WARN_ON that can never trigger Christophe JAILLET
2017-01-31 14:44 ` 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).