Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2390157ybe; Sat, 7 Sep 2019 14:44:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwX0yrirOkJjh8krLnTyl6OsOdta0lfvxJV4WeH2rUZTwoTgYHrXzUjxq305dF680ZyY0dl X-Received: by 2002:a65:4507:: with SMTP id n7mr13755073pgq.86.1567892663042; Sat, 07 Sep 2019 14:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567892663; cv=none; d=google.com; s=arc-20160816; b=AfNI6NhofWYS8G8nq7OgxjXP8cmN3cK3+3Qa8s6vHoV/hapS+/hGwm576s8ky3FDUb KqWhmg7eceSKg7RlM0IwW4cE7vtswGjuD1LHP6rCLEDecPGjYzgylrjcLo/WrgyAH1+z 2UPTZ5BqJnAEOLc+uWQk4iMf3NAO6dqGtW6cogdp3oBbs3eAykbnbk61F6OHhhFg72vd FogEY2zrTfNOupe4HKuwEIhlm1e6tjR3n87Fs62OI0N5TREHwWm3FyiKv5obi3QEQyaO a8r9NihJZyU6Ej804SLfoXXvb61Dmtlu1H9KnkH/naO9e27g3swZI5CwqIyKW0gU8FIC FA8Q== 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; bh=yerg+pwqu6rMSSqkUHGA1loL5scPjjuQrip6hiZE2cc=; b=Qo26bRyfEZm/d9gGwBdZeD5J+Td8FFAoAtfZSlrRbDi0lXorF8fMhoByEpzRpjjne3 SHy6D1RNJzCwJvbsASkp/VtLOB7VulaXLQvpYEXjp6wBCIvSJDY2h4R+4Qq9kev7L/kH kTQC3Q5A0U/414KiaHDDmfHZz6DKE8B4oO2eBY6YHRzKQpbNgROYIjN4yMrpxy2gfO5r osna4ssKVlzt01pkbtH3pfBXe+xH7gKlluV8mQJeQggcxOuC6y4osQulFKEQSdJFmuVr Qm8OAetcC+EdHzeIyqANx1wlBKBol/wOwmy5XCxblvCXC1HMA/osK0FZrhxgCvfst1gd Gq3A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s23si8558215pgq.516.2019.09.07.14.44.07; Sat, 07 Sep 2019 14:44:23 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393322AbfIFTaq (ORCPT + 99 others); Fri, 6 Sep 2019 15:30:46 -0400 Received: from foss.arm.com ([217.140.110.172]:60564 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730615AbfIFTap (ORCPT ); Fri, 6 Sep 2019 15:30:45 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EC7CD28; Fri, 6 Sep 2019 12:30:42 -0700 (PDT) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3C5EB3F718; Fri, 6 Sep 2019 12:30:42 -0700 (PDT) Date: Fri, 6 Sep 2019 20:30:40 +0100 From: Andrew Murray To: Markus Elfring Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, Binghui Wang , Bjorn Helgaas , Jingoo Han , Kevin Hilman , Krzysztof Kozlowski , Kukjin Kim , Lorenzo Pieralisi , Yue Wang , Xiaowei Song , YueHaibing , zhong jiang , kernel-janitors@vger.kernel.org, LKML Subject: Re: [PATCH] PCI: dwc: Use PTR_ERR_OR_ZERO() in five functions Message-ID: <20190906193040.GG9720@e119886-lin.cambridge.arm.com> References: <95c9dfae-af81-82ad-e989-1fdf5f29808e@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95c9dfae-af81-82ad-e989-1fdf5f29808e@web.de> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 06, 2019 at 08:50:07PM +0200, Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 6 Sep 2019 20:40:06 +0200 > > Simplify these function implementations by using a known function. > > Generated by: scripts/coccinelle/api/ptr_ret.cocci > > Signed-off-by: Markus Elfring Thanks for this, looks good to me: Reviewed-by: Andrew Murray > --- > drivers/pci/controller/dwc/pci-exynos.c | 5 +---- > drivers/pci/controller/dwc/pci-meson.c | 10 ++-------- > drivers/pci/controller/dwc/pcie-kirin.c | 10 ++-------- > 3 files changed, 5 insertions(+), 20 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-exynos.c b/drivers/pci/controller/dwc/pci-exynos.c > index cee5f2f590e2..b6ab1cc5d895 100644 > --- a/drivers/pci/controller/dwc/pci-exynos.c > +++ b/drivers/pci/controller/dwc/pci-exynos.c > @@ -92,10 +92,7 @@ static int exynos5440_pcie_get_mem_resources(struct platform_device *pdev, > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > ep->mem_res->elbi_base = devm_ioremap_resource(dev, res); > - if (IS_ERR(ep->mem_res->elbi_base)) > - return PTR_ERR(ep->mem_res->elbi_base); > - > - return 0; > + return PTR_ERR_OR_ZERO(ep->mem_res->elbi_base); > } > > static int exynos5440_pcie_get_clk_resources(struct exynos_pcie *ep) > diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c > index e35e9eaa50ee..713059918002 100644 > --- a/drivers/pci/controller/dwc/pci-meson.c > +++ b/drivers/pci/controller/dwc/pci-meson.c > @@ -182,10 +182,7 @@ static int meson_pcie_get_mems(struct platform_device *pdev, > > /* Meson SoC has two PCI controllers use same phy register*/ > mp->mem_res.phy_base = meson_pcie_get_mem_shared(pdev, mp, "phy"); > - if (IS_ERR(mp->mem_res.phy_base)) > - return PTR_ERR(mp->mem_res.phy_base); > - > - return 0; > + return PTR_ERR_OR_ZERO(mp->mem_res.phy_base); > } > > static void meson_pcie_power_on(struct meson_pcie *mp) > @@ -259,10 +256,7 @@ static int meson_pcie_probe_clocks(struct meson_pcie *mp) > return PTR_ERR(res->general_clk); > > res->clk = meson_pcie_probe_clock(dev, "pcie", 0); > - if (IS_ERR(res->clk)) > - return PTR_ERR(res->clk); > - > - return 0; > + return PTR_ERR_OR_ZERO(res->clk); > } > > static inline void meson_elb_writel(struct meson_pcie *mp, u32 val, u32 reg) > diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c > index c19617a912bd..75b1f1dde747 100644 > --- 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 kirin_pcie *kirin_pcie, > 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(struct kirin_pcie *kirin_pcie, > > 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) > -- > 2.23.0 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel