Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1548111 > unrolled thread

[PATCH] power_supply: wm97xx_battery: remove redundant 2nd null check on pdata

Started byColin King <colin.king@canonical.com>
First post2016-12-29 16:30 +0100
Last post2016-12-29 16:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] power_supply: wm97xx_battery: remove redundant 2nd null check on pdata Colin King <colin.king@canonical.com> - 2016-12-29 16:30 +0100

#1548111 — [PATCH] power_supply: wm97xx_battery: remove redundant 2nd null check on pdata

FromColin King <colin.king@canonical.com>
Date2016-12-29 16:30 +0100
Subject[PATCH] power_supply: wm97xx_battery: remove redundant 2nd null check on pdata
Message-ID<sTKOt-8iW-3@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

pdata is being null checked twice, the 2nd check is redundant code
and can be removed.

Fixes CoverityScan CID 1392340 "Logically dead code"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/power/supply/wm97xx_battery.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/power/supply/wm97xx_battery.c b/drivers/power/supply/wm97xx_battery.c
index e3edb31..bd4f666 100644
--- a/drivers/power/supply/wm97xx_battery.c
+++ b/drivers/power/supply/wm97xx_battery.c
@@ -175,11 +175,6 @@ static int wm97xx_bat_probe(struct platform_device *dev)
 	if (dev->id != -1)
 		return -EINVAL;
 
-	if (!pdata) {
-		dev_err(&dev->dev, "No platform_data supplied\n");
-		return -EINVAL;
-	}
-
 	if (gpio_is_valid(pdata->charge_gpio)) {
 		ret = gpio_request(pdata->charge_gpio, "BATT CHRG");
 		if (ret)
-- 
2.10.2

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web