lkml.org 
[lkml]   [2018]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH-next] powerpc/fsl_pci: Use PTR_ERR_OR_ZERO
From
Date
On 01/23/2018 12:37 PM, Christopher Díaz Riveros wrote:
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>
> ---

Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>

> arch/powerpc/sysdev/fsl_pci.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
> index cc20d2255d7f..142184635c81 100644
> --- a/arch/powerpc/sysdev/fsl_pci.c
> +++ b/arch/powerpc/sysdev/fsl_pci.c
> @@ -1304,10 +1304,7 @@ static int add_err_dev(struct platform_device *pdev)
> pdev->resource,
> pdev->num_resources,
> &pd, sizeof(pd));
> - if (IS_ERR(errdev))
> - return PTR_ERR(errdev);
> -
> - return 0;
> + return PTR_ERR_OR_ZERO(errdev);
> }
>
> static int fsl_pci_probe(struct platform_device *pdev)
>

\
 
 \ /
  Last update: 2018-01-24 04:33    [W:0.033 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site