Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH] regulator: lp8788-ldo: fix odd_ptr_err.cocci warnings
@ 2018-01-03  6:19 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2018-01-03  6:19 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, kbuild-all

From: Fengguang Wu <fengguang.wu@intel.com>

 PTR_ERR should normally access the value just tested by IS_ERR

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

Fixes: 460e9d2590fe ("regulator: lp8788-ldo: Pass descriptor instead of GPIO number")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

Semantic patch information:
 There can be false positives in the patch case, where it is the call to
 IS_ERR that is wrong.

 lp8788-ldo.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/regulator/lp8788-ldo.c
+++ b/drivers/regulator/lp8788-ldo.c
@@ -507,7 +507,7 @@ static int lp8788_config_ldo_enable_mode
 						       enable_id,
 						       GPIOD_OUT_HIGH);
 	if (IS_ERR(ldo->ena_gpiod))
-		return PTR_ERR(ldo->ena->gpiod);
+		return PTR_ERR(ldo->ena_gpiod);

 	/* if no GPIO for ldo pin, then set default enable mode */
 	if (!ldo->ena_gpiod)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-03  6:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-03  6:19 [PATCH] regulator: lp8788-ldo: fix odd_ptr_err.cocci warnings Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox