* [PATCH] power_supply: wm97xx_battery: remove redundant 2nd null check on pdata
@ 2016-12-29 15:23 Colin King
2017-01-04 21:21 ` Sebastian Reichel
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-12-29 15:23 UTC (permalink / raw)
To: Sebastian Reichel, linux-pm; +Cc: linux-kernel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] power_supply: wm97xx_battery: remove redundant 2nd null check on pdata
2016-12-29 15:23 [PATCH] power_supply: wm97xx_battery: remove redundant 2nd null check on pdata Colin King
@ 2017-01-04 21:21 ` Sebastian Reichel
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2017-01-04 21:21 UTC (permalink / raw)
To: Colin King; +Cc: linux-pm, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
Hi Colin,
On Thu, Dec 29, 2016 at 03:23:12PM +0000, Colin King wrote:
> 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>
Thanks for your patch. I have queued it into power-supply's
for-next branch:
https://git.kernel.org/cgit/linux/kernel/git/sre/linux-power-supply.git/log/?h=for-next
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-04 21:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-29 15:23 [PATCH] power_supply: wm97xx_battery: remove redundant 2nd null check on pdata Colin King
2017-01-04 21:21 ` Sebastian Reichel
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).