[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181008181800.GA119382@ivb43.lkp.intel.com>
Date: Tue, 9 Oct 2018 02:18:00 +0800
From: kbuild test robot <fengguang.wu@...el.com>
To: Hanjie Lin <hanjie.lin@...ogic.com>
Cc: kbuild-all@...org, Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Yue Wang <yue.wang@...ogic.com>,
Hanjie Lin <hanjie.lin@...ogic.com>,
Kevin Hilman <khilman@...libre.com>,
Carlo Caione <carlo@...one.org>,
Jerome Brunet <jbrunet@...libre.com>,
Rob Herring <robh@...nel.org>,
Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
Shawn Lin <shawn.lin@...k-chips.com>,
Philippe Ombredanne <pombredanne@...b.com>,
Cyrille Pitchen <cyrille.pitchen@...e-electrons.com>,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-amlogic@...ts.infradead.org,
Yixun Lan <yixun.lan@...ogic.com>,
Liang Yang <liang.yang@...ogic.com>,
Jianxin Pan <jianxin.pan@...ogic.com>,
Qiufang Dai <qiufang.dai@...ogic.com>,
Jian Hu <jian.hu@...ogic.com>
Subject: [PATCH] PCI: amlogic: fix ptr_ret.cocci warnings
From: kbuild test robot <fengguang.wu@...el.com>
drivers/pci/controller/dwc/pci-meson.c:190:1-3: WARNING: PTR_ERR_OR_ZERO can be used
drivers/pci/controller/dwc/pci-meson.c:267: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: 32cd91ffa92f ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver")
CC: Yue Wang <yue.wang@...ogic.com>
Signed-off-by: kbuild test robot <fengguang.wu@...el.com>
---
url: https://github.com/0day-ci/linux/commits/Hanjie-Lin/add-the-Amlogic-Meson-PCIe-controller-driver/20181009-001429
base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
pci-meson.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
--- a/drivers/pci/controller/dwc/pci-meson.c
+++ b/drivers/pci/controller/dwc/pci-meson.c
@@ -187,10 +187,7 @@ static int meson_pcie_get_mems(struct pl
/* Meson SoC has two PCI controllers use same phy register*/
mp->mem_res.phy_base = meson_pcie_get_mem_shared(pdev, mp, "phy");
- if (IS_ERR(mp->mem_res.phy_base))
- return PTR_ERR(mp->mem_res.phy_base);
-
- return 0;
+ return PTR_ERR_OR_ZERO(mp->mem_res.phy_base);
}
static void meson_pcie_power_on(struct meson_pcie *mp)
@@ -264,10 +261,7 @@ static int meson_pcie_probe_clocks(struc
return PTR_ERR(res->general_clk);
res->clk = meson_pcie_probe_clock(dev, "pcie", 0);
- if (IS_ERR(res->clk))
- return PTR_ERR(res->clk);
-
- return 0;
+ return PTR_ERR_OR_ZERO(res->clk);
}
static inline void meson_elb_writel(struct meson_pcie *mp, u32 val, u32 reg)
Powered by blists - more mailing lists