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

* Re: [patch] power: supply: lp8788: remove an unneeded NULL check
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Kim, Milo @ 2016-10-17  0:40 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Sebastian Reichel, linux-pm, linux-kernel, kernel-janitors

On 10/14/2016 4:33 PM, Dan Carpenter wrote:
> 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>

Acked-by: Milo Kim <milo.kim@ti.com>

Thanks for catching this.

Best regards,
Milo

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

* Re: [patch] power: supply: lp8788: remove an unneeded NULL check
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2016-10-19  3:38 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Milo Kim, linux-pm, linux-kernel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

Hi Dan,

On Fri, Oct 14, 2016 at 10:33:28AM +0300, Dan Carpenter wrote:
> 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)

Thanks, queued.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[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).