[PATCH] fix ptr_ret.cocci warnings
From: kbuild test robot
Date: Fri Dec 20 2019 - 20:20:46 EST
From: kbuild test robot <lkp@xxxxxxxxx>
drivers/pci/controller/pcie-rockchip-host.c:628: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
Fixes: 069ade5dfec9 ("Merge branch 'remotes/lorenzo/pci/rockchip'")
Signed-off-by: kbuild test robot <lkp@xxxxxxxxx>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b371ddb94fae82b6565020639b7db31934043c65
commit: 069ade5dfec93dd2916a85df8b1bab2d578857bd Merge branch 'remotes/lorenzo/pci/rockchip'
pcie-rockchip-host.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/pci/controller/pcie-rockchip-host.c
+++ b/drivers/pci/controller/pcie-rockchip-host.c
@@ -625,10 +625,7 @@ static int rockchip_pcie_parse_host_dt(s
return PTR_ERR(rockchip->vpcie1v8);
rockchip->vpcie0v9 = devm_regulator_get(dev, "vpcie0v9");
- if (IS_ERR(rockchip->vpcie0v9))
- return PTR_ERR(rockchip->vpcie0v9);
-
- return 0;
+ return PTR_ERR_OR_ZERO(rockchip->vpcie0v9);
}
static int rockchip_pcie_set_vpcie(struct rockchip_pcie *rockchip)