linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] power: supply: lp8788: remove an unneeded NULL check
@ 2016-10-14  7:33 Dan Carpenter
  2016-10-17  0:40 ` Kim, Milo
  2016-10-19  3:38 ` Sebastian Reichel
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-10-14  7:33 UTC (permalink / raw)
  To: Milo Kim; +Cc: Sebastian Reichel, linux-pm, linux-kernel, kernel-janitors

We checked that "pdata->chg_params" is non-NULL earlier in this function
so when we add "i" to it, it's still non-NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/power/supply/lp8788-charger.c b/drivers/power/supply/lp8788-charger.c
index 7321b72..509e2b3 100644
--- a/drivers/power/supply/lp8788-charger.c
+++ b/drivers/power/supply/lp8788-charger.c
@@ -384,9 +384,6 @@ static int lp8788_update_charger_params(struct platform_device *pdev,
 	for (i = 0; i < pdata->num_chg_params; i++) {
 		param = pdata->chg_params + i;
 
-		if (!param)
-			continue;
-
 		if (lp8788_is_valid_charger_register(param->addr)) {
 			ret = lp8788_write_byte(lp, param->addr, param->val);
 			if (ret)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-19  3:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-14  7:33 [patch] power: supply: lp8788: remove an unneeded NULL check Dan Carpenter
2016-10-17  0:40 ` Kim, Milo
2016-10-19  3:38 ` 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).