From: Vasyl Gomonovych Date: Mon, 27 Nov 2017 21:37:33 +0000 (+0100) Subject: powerpc/fsl_pci: Fix ptr_ret.cocci warnings X-Git-Tag: v5.15~9492^2~54^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d038386a0cecaf5283745f951bc35c49bd78da22;p=platform%2Fkernel%2Flinux-starfive.git powerpc/fsl_pci: Fix ptr_ret.cocci warnings arch/powerpc/sysdev/fsl_pci.c:1307:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Vasyl Gomonovych Signed-off-by: Scott Wood --- diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 0c524c2..dd89df7 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -1304,10 +1304,8 @@ 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)