From: kbuild test robot <fengguang.wu@intel.com>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
Bjorn Helgaas <helgaas@kernel.org>,
Xiaowei Song <songxiaowei@hisilicon.com>,
Binghui Wang <wangbinghui@hisilicon.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
linux-pci@vger.kernel.org
Subject: [PATCH] PCI: fix ptr_ret.cocci warnings
Date: Fri, 20 Jul 2018 07:42:43 +0800 [thread overview]
Message-ID: <20180719234243.GA4239@athens> (raw)
In-Reply-To: <201807200739.O5DHU6D3%fengguang.wu@intel.com>
From: kbuild test robot <fengguang.wu@intel.com>
drivers/pci/controller/dwc/pcie-kirin.c:141:1-3: WARNING: PTR_ERR_OR_ZERO can be used
drivers/pci/controller/dwc/pcie-kirin.c:177: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: 6e0832fa432e ("PCI: Collect all native drivers under drivers/pci/controller/")
CC: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
---
pcie-kirin.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
--- a/drivers/pci/controller/dwc/pcie-kirin.c
+++ b/drivers/pci/controller/dwc/pcie-kirin.c
@@ -138,10 +138,7 @@ static long kirin_pcie_get_clk(struct ki
return PTR_ERR(kirin_pcie->apb_sys_clk);
kirin_pcie->pcie_aclk = devm_clk_get(dev, "pcie_aclk");
- if (IS_ERR(kirin_pcie->pcie_aclk))
- return PTR_ERR(kirin_pcie->pcie_aclk);
-
- return 0;
+ return PTR_ERR_OR_ZERO(kirin_pcie->pcie_aclk);
}
static long kirin_pcie_get_resource(struct kirin_pcie *kirin_pcie,
@@ -174,10 +171,7 @@ static long kirin_pcie_get_resource(stru
kirin_pcie->sysctrl =
syscon_regmap_lookup_by_compatible("hisilicon,hi3660-sctrl");
- if (IS_ERR(kirin_pcie->sysctrl))
- return PTR_ERR(kirin_pcie->sysctrl);
-
- return 0;
+ return PTR_ERR_OR_ZERO(kirin_pcie->sysctrl);
}
static int kirin_pcie_phy_init(struct kirin_pcie *kirin_pcie)
next parent reply other threads:[~2018-07-19 23:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201807200739.O5DHU6D3%fengguang.wu@intel.com>
2018-07-19 23:42 ` kbuild test robot [this message]
[not found] <202001051538.1jMWp6L9%lkp@intel.com>
2020-01-05 7:21 ` [PATCH] PCI: fix ptr_ret.cocci warnings kbuild test robot
[not found] <201912272041.iVxC623g%lkp@intel.com>
2019-12-27 12:18 ` kbuild test robot
[not found] <201807120738.oIXXb65q%fengguang.wu@intel.com>
2018-07-11 23:30 ` kbuild test robot
2018-09-18 14:18 ` Lorenzo Pieralisi
2018-09-18 14:18 ` Lorenzo Pieralisi
2018-09-18 14:47 ` Thierry Reding
2018-09-18 14:47 ` Thierry Reding
2018-09-18 16:30 ` Lorenzo Pieralisi
2018-09-18 16:30 ` Lorenzo Pieralisi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180719234243.GA4239@athens \
--to=fengguang.wu@intel.com \
--cc=helgaas@kernel.org \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=shawn.lin@rock-chips.com \
--cc=songxiaowei@hisilicon.com \
--cc=wangbinghui@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).