From patchwork Sat Feb 4 01:35:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 9555447 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 25865604EB for ; Sat, 4 Feb 2017 01:36:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1550A1FE82 for ; Sat, 4 Feb 2017 01:36:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A17A28111; Sat, 4 Feb 2017 01:36:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81C5E26E97 for ; Sat, 4 Feb 2017 01:36:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753310AbdBDBgY (ORCPT ); Fri, 3 Feb 2017 20:36:24 -0500 Received: from mga07.intel.com ([134.134.136.100]:7278 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753138AbdBDBgY (ORCPT ); Fri, 3 Feb 2017 20:36:24 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 03 Feb 2017 17:36:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,331,1477983600"; d="scan'208";a="39541538" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga002.jf.intel.com with ESMTP; 03 Feb 2017 17:36:21 -0800 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1cZpJH-000RMZ-Rd; Sat, 04 Feb 2017 09:38:39 +0800 Date: Sat, 4 Feb 2017 09:35:32 +0800 From: kbuild test robot To: Kishon Vijay Abraham I Cc: kbuild-all@01.org, linux-pci@vger.kernel.org, Bjorn Helgaas , Pankaj Dubey Subject: [PATCH] PCI: dwc: fix ptr_ret.cocci warnings Message-ID: <20170204013531.GA26132@lkp-wsm-ep2> References: <201702040917.XTwXdmmt%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201702040917.XTwXdmmt%fengguang.wu@intel.com> 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 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/pci/dwc/pcie-qcom.c:215:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/pci/dwc/pcie-qcom.c:247:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/pci/dwc/pcie-qcom.c:481: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: Kishon Vijay Abraham I Signed-off-by: Fengguang Wu --- pcie-qcom.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) --- a/drivers/pci/dwc/pcie-qcom.c +++ b/drivers/pci/dwc/pcie-qcom.c @@ -212,10 +212,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) @@ -244,10 +241,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) @@ -478,10 +472,7 @@ static int qcom_pcie_get_resources_v2(st return PTR_ERR(res->slave_clk); res->pipe_clk = devm_clk_get(dev, "pipe"); - if (IS_ERR(res->pipe_clk)) - return PTR_ERR(res->pipe_clk); - - return 0; + return PTR_ERR_OR_ZERO(res->pipe_clk); } static int qcom_pcie_init_v2(struct qcom_pcie *pcie)