lkml.org 
[lkml]   [2019]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fix ptr_ret.cocci warnings
From: kbuild test robot <lkp@intel.com>

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@intel.com>
---

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)
\
 
 \ /
  Last update: 2019-12-21 02:20    [W:0.025 / U:0.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site