Re: [patch] power: supply: lp8788: remove an unneeded NULL check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> 
> 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: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux