From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38D47C433F4 for ; Tue, 18 Sep 2018 14:21:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC69A214DA for ; Tue, 18 Sep 2018 14:21:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC69A214DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729751AbeIRTyP (ORCPT ); Tue, 18 Sep 2018 15:54:15 -0400 Received: from foss.arm.com ([217.140.101.70]:45742 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727228AbeIRTyP (ORCPT ); Tue, 18 Sep 2018 15:54:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C4CEA7A9; Tue, 18 Sep 2018 07:21:26 -0700 (PDT) Received: from e107981-ln.cambridge.arm.com (e107981-ln.emea.arm.com [10.4.13.117]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6F1333F5BD; Tue, 18 Sep 2018 07:21:25 -0700 (PDT) Date: Tue, 18 Sep 2018 15:21:22 +0100 From: Lorenzo Pieralisi To: kbuild test robot , Xiaowei Song , Binghui Wang Cc: Shawn Lin , kbuild-all@01.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: Re: [PATCH] PCI: fix ptr_ret.cocci warnings Message-ID: <20180918142122.GB32243@e107981-ln.cambridge.arm.com> References: <201807200739.O5DHU6D3%fengguang.wu@intel.com> <20180719234243.GA4239@athens> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180719234243.GA4239@athens> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 20, 2018 at 07:42:43AM +0800, kbuild test robot wrote: > 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(-) Xiaowei, Binghui, are you OK with this change ? I will remove the Fixes: tag from the patch. Let me know, thanks. Lorenzo > --- 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)