linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Yue Wang <yue.wang@Amlogic.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Rob Herring <robh@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-pci@vger.kernel.org, linux-safety@lists.elisa.tech,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org
Subject: Re: [PATCH] PCI: dwc/meson: Use PTR_ERR_OR_ZERO
Date: Tue, 17 Nov 2020 09:36:06 +0100	[thread overview]
Message-ID: <b28005c3-de6d-79db-34e6-b5298b9f0224@baylibre.com> (raw)
In-Reply-To: <20201116163418.10529-1-sudipm.mukherjee@gmail.com>

On 16/11/2020 17:34, Sudip Mukherjee wrote:
> Coccinelle suggested using PTR_ERR_OR_ZERO() and looking at the code,
> we can use PTR_ERR_OR_ZERO() instead of checking IS_ERR() and then
> doing 'return 0'.
> 
> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> ---
>  drivers/pci/controller/dwc/pci-meson.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
> index 1913dc2c8fa0..f4261f5aceb1 100644
> --- a/drivers/pci/controller/dwc/pci-meson.c
> +++ b/drivers/pci/controller/dwc/pci-meson.c
> @@ -115,10 +115,8 @@ static int meson_pcie_get_mems(struct platform_device *pdev,
>  		return PTR_ERR(pci->dbi_base);
>  
>  	mp->cfg_base = devm_platform_ioremap_resource_byname(pdev, "cfg");
> -	if (IS_ERR(mp->cfg_base))
> -		return PTR_ERR(mp->cfg_base);
>  
> -	return 0;
> +	return PTR_ERR_OR_ZERO(mp->cfg_base);
>  }
>  
>  static int meson_pcie_power_on(struct meson_pcie *mp)
> @@ -208,10 +206,8 @@ static int meson_pcie_probe_clocks(struct meson_pcie *mp)
>  		return PTR_ERR(res->general_clk);
>  
>  	res->clk = meson_pcie_probe_clock(dev, "pclk", 0);
> -	if (IS_ERR(res->clk))
> -		return PTR_ERR(res->clk);
>  
> -	return 0;
> +	return PTR_ERR_OR_ZERO(res->clk);
>  }
>  
>  static inline u32 meson_cfg_readl(struct meson_pcie *mp, u32 reg)
> 

Hi,

This has been nacked multiple times already:
https://lore.kernel.org/linux-pci/20190527140952.GB7202@ulmo/

Neil

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2020-11-17  8:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 16:34 [PATCH] PCI: dwc/meson: Use PTR_ERR_OR_ZERO Sudip Mukherjee
2020-11-17  8:36 ` Neil Armstrong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b28005c3-de6d-79db-34e6-b5298b9f0224@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=bhelgaas@google.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-safety@lists.elisa.tech \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=robh@kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=yue.wang@Amlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).