Skip to contentSkip to conversation

powerpc/fsl_pci: Fix ptr_ret.cocci warnings

PATCH New Vasyl Gomonovych 1 participant 1 message Nov 27, 2017 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 arch/powerpc/sysdev/fsl_pci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/powerpc/sysdev/fsl_pci.c +1 -3
index 22d98057f773..e5afc3a9b533 100644
@@ -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)
Signature · 1 line
1.9.1