Re: [PATCH -next] sh-pfc: Use PTR_ERR_OR_ZERO() to simplify the code

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

 



Hello Wei,

Thank you for the patch.

On Wednesday 06 Jul 2016 12:03:32 weiyj_lk@xxxxxxx wrote:
> From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
> 
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>

Acked-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

> ---
>  drivers/pinctrl/sh-pfc/pinctrl.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c
> b/drivers/pinctrl/sh-pfc/pinctrl.c index d4e65bc..e208ee0 100644
> --- a/drivers/pinctrl/sh-pfc/pinctrl.c
> +++ b/drivers/pinctrl/sh-pfc/pinctrl.c
> @@ -814,8 +814,5 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
>  	pmx->pctl_desc.npins = pfc->info->nr_pins;
> 
>  	pmx->pctl = devm_pinctrl_register(pfc->dev, &pmx->pctl_desc, pmx);
> -	if (IS_ERR(pmx->pctl))
> -		return PTR_ERR(pmx->pctl);
> -
> -	return 0;
> +	return PTR_ERR_OR_ZERO(pmx->pctl);
>  }

-- 
Regards,

Laurent Pinchart




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux