From patchwork Fri Dec 18 13:44:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 7884091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 013DEBEEE5 for ; Fri, 18 Dec 2015 13:47:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3723A2041D for ; Fri, 18 Dec 2015 13:47:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5CF28203E6 for ; Fri, 18 Dec 2015 13:47:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a9vMR-0006Av-Fc; Fri, 18 Dec 2015 13:46:19 +0000 Received: from mga04.intel.com ([192.55.52.120]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a9vML-00066D-As for linux-arm-kernel@lists.infradead.org; Fri, 18 Dec 2015 13:46:14 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 18 Dec 2015 05:45:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,446,1444719600"; d="scan'208";a="874278160" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga002.jf.intel.com with ESMTP; 18 Dec 2015 05:45:29 -0800 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1a9vLb-000Tjm-3e; Fri, 18 Dec 2015 21:45:27 +0800 Date: Fri, 18 Dec 2015 21:44:15 +0800 From: kbuild test robot To: Stanimir Varbanov Subject: [PATCH] PCI: qcom: fix ptr_ret.cocci warnings Message-ID: <20151218134415.GA31877@lkp-hsx03> References: <201512182111.1GLn2hxy%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1450442339-18765-4-git-send-email-stanimir.varbanov@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151218_054613_549306_6DC0F6AB X-CRM114-Status: GOOD ( 11.35 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Pratyush Anand , Russell King , Arnd Bergmann , Pawel Moll , linux-arm-msm@vger.kernel.org, Ian Campbell , linux-kernel@vger.kernel.org, Stanimir Varbanov , Stanimir Varbanov , Jingoo Han , Rob Herring , Srinivas Kandagatla , kbuild-all@01.org, Bjorn Andersson , linux-pci@vger.kernel.org, Bjorn Helgaas , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/pci/host/pcie-qcom.c:188:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/pci/host/pcie-qcom.c:220: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 CC: Stanimir Varbanov Signed-off-by: Fengguang Wu --- pcie-qcom.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) --- a/drivers/pci/host/pcie-qcom.c +++ b/drivers/pci/host/pcie-qcom.c @@ -185,10 +185,7 @@ static int qcom_pcie_get_resources_v0(st return PTR_ERR(res->por_reset); res->phy_reset = devm_reset_control_get(dev, "phy"); - if (IS_ERR(res->phy_reset)) - return PTR_ERR(res->phy_reset); - - return 0; + return PTR_ERR_OR_ZERO(res->phy_reset); } static int qcom_pcie_get_resources_v1(struct qcom_pcie *pcie) @@ -217,10 +214,7 @@ static int qcom_pcie_get_resources_v1(st return PTR_ERR(res->slave_bus); res->core = devm_reset_control_get(dev, "core"); - if (IS_ERR(res->core)) - return PTR_ERR(res->core); - - return 0; + return PTR_ERR_OR_ZERO(res->core); } static void qcom_pcie_deinit_v0(struct qcom_pcie *pcie)