linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin King <colin.king@canonical.com>
To: Sebastian Reichel <sre@kernel.org>, linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] power_supply: wm97xx_battery: remove redundant 2nd null check on pdata
Date: Thu, 29 Dec 2016 15:23:12 +0000	[thread overview]
Message-ID: <20161229152312.20537-1-colin.king@canonical.com> (raw)

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


             reply	other threads:[~2016-12-29 15:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-29 15:23 Colin King [this message]
2017-01-04 21:21 ` [PATCH] power_supply: wm97xx_battery: remove redundant 2nd null check on pdata Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161229152312.20537-1-colin.king@canonical.com \
    --to=colin.king@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).