From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Subject: [PATCH] regulator: lp8788-ldo: fix odd_ptr_err.cocci warnings Date: Wed, 3 Jan 2018 07:19:46 +0100 (CET) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:42933 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbeACGTs (ORCPT ); Wed, 3 Jan 2018 01:19:48 -0500 Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Linus Walleij Cc: linux-gpio@vger.kernel.org, kbuild-all@01.org From: Fengguang Wu 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 Signed-off-by: Julia Lawall --- 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)