From patchwork Thu Jul 19 23:42:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 10535753 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 1D752601D2 for ; Thu, 19 Jul 2018 23:43:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 119D329A04 for ; Thu, 19 Jul 2018 23:43:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0557229A48; Thu, 19 Jul 2018 23:43:44 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 A484C29A04 for ; Thu, 19 Jul 2018 23:43:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730776AbeGTA3E (ORCPT ); Thu, 19 Jul 2018 20:29:04 -0400 Received: from mga03.intel.com ([134.134.136.65]:48972 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728103AbeGTA3D (ORCPT ); Thu, 19 Jul 2018 20:29:03 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2018 16:43:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,376,1526367600"; d="scan'208";a="72863275" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga004.fm.intel.com with ESMTP; 19 Jul 2018 16:43:34 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1fgIa5-000TfG-Q8; Fri, 20 Jul 2018 07:43:33 +0800 Date: Fri, 20 Jul 2018 07:42:43 +0800 From: kbuild test robot To: Shawn Lin Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Xiaowei Song , Binghui Wang , Lorenzo Pieralisi , linux-pci@vger.kernel.org Subject: [PATCH] PCI: fix ptr_ret.cocci warnings Message-ID: <20180719234243.GA4239@athens> References: <201807200739.O5DHU6D3%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201807200739.O5DHU6D3%fengguang.wu@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: lkp@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 From: kbuild test robot 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 Signed-off-by: kbuild test robot --- 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)