Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2262671imm; Thu, 19 Jul 2018 16:44:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcMcUhmoA5zBrZ7pc/2V+gWNo8d6KDpoBXpq4tCeVaJL8NtzU6yEEROfeoPsEExrlBfV6PS X-Received: by 2002:a17:902:6105:: with SMTP id t5-v6mr12050366plj.92.1532043890637; Thu, 19 Jul 2018 16:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532043890; cv=none; d=google.com; s=arc-20160816; b=DCp18q0OUPuOi+dk/qqArpndkaakY40yfR+TksknMleq1sCEW2EvuLo67IQSya+487 5gNpcVipqWqoZz84vkqmosqmPReiGEYxOZDZijB6H7MqUwolhd19NGQ7e8EoGZ9H12aR yA2AVsL9U3xgbxSTaea9nG5w4sw7c2pH5pol0rBrCu64lUyKMts9wGwLqJt/Vu39q9nx 6+616ynpBRBu+3SIU4hmjru4GrhrBpLm/xwNfZLAKYZO8t+tDaNw0S5UqygLz4K71RZQ dWplQRLzFWPPoKdm9LAW+QCCzS5VAnPLLH7DB6ZCX9guK1e7FkDwWejcyHXmw02XcrYQ Wi+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=A0CgfHzpwsY5WuRV7B70IOBMWZHrltDUD+VoJTr8mbY=; b=iRyoAxXPW1Pe251zbyDhdVEiLdPJPw9t0UGHOcj8DvPk45/6otqEPOx8GIUZeOB7Di XdeVU5D9B7elTk1HhCV2SHPMzVgOMTYYbljYbeK0TD2T/r1GmYhqsZYnyKqCmRb/lKcH kop+GZor92+/ZX5JJqrQ03Din8FrLFR3EJFzIbe4+yR+MsDvtnio/f5z9NmuZrIaKp29 +ih8jyBaqiWlcMs0vHblo62A/pNjbGtqvC4NOL9W8JfpCSYFDWMtrnuea69PYQfZ7e0j lF0nRbCsOtmemsZqmEYeYToeeKsvC/S/IFgfscu+rMo6XGfZLySw0AbBs5L2XfyzjUzz ZrDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10-v6si407528pfk.228.2018.07.19.16.44.35; Thu, 19 Jul 2018 16:44:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730880AbeGTA3E (ORCPT + 99 others); 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-Type: text/plain; charset=us-ascii 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)