linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Gonzalez <marc.w.gonzalez@free.fr>
To: Hariprasad Kelam <hariprasad.kelam@gmail.com>,
	Bjorn Helgaas <helgaas@kernel.org>
Cc: MSM <linux-arm-msm@vger.kernel.org>,
	PCI <linux-pci@vger.kernel.org>,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>
Subject: Re: [PATCH] drivers/pci/controller: fix warning PTR_ERR_OR_ZERO can be used
Date: Mon, 27 May 2019 14:40:58 +0200	[thread overview]
Message-ID: <085da143-9d13-8741-9f6c-489754fef9f6@free.fr> (raw)
In-Reply-To: <20190525085748.GA10926@hari-Inspiron-1545>

On 25/05/2019 10:57, Hariprasad Kelam wrote:

> fix below warnings reported by coccichek
> 
> /drivers/pci/controller/pci-tegra.c:1132:1-3: WARNING: PTR_ERR_OR_ZERO
> can be used
> ./drivers/pci/controller/dwc/pcie-qcom.c:703:1-3: WARNING:
> PTR_ERR_OR_ZERO can be used
> ./drivers/pci/controller/dwc/pci-meson.c:185:1-3: WARNING:
> PTR_ERR_OR_ZERO can be used
> ./drivers/pci/controller/dwc/pci-meson.c:262:1-3: WARNING:
> PTR_ERR_OR_ZERO can be used
> ./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
> ./drivers/pci/controller/dwc/pci-exynos.c:95:1-3: WARNING:
> PTR_ERR_OR_ZERO can be used
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> ---
>  drivers/pci/controller/dwc/pci-exynos.c | 4 +---
>  drivers/pci/controller/dwc/pci-meson.c  | 8 ++------
>  drivers/pci/controller/dwc/pcie-kirin.c | 8 ++------
>  drivers/pci/controller/dwc/pcie-qcom.c  | 4 +---
>  drivers/pci/controller/pci-tegra.c      | 4 +---
>  5 files changed, 7 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 0ed235d..6c421e6 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -700,10 +700,8 @@ static int qcom_pcie_get_resources_2_4_0(struct qcom_pcie *pcie)
>  		return PTR_ERR(res->ahb_reset);
>  
>  	res->phy_ahb_reset = devm_reset_control_get_exclusive(dev, "phy_ahb");
> -	if (IS_ERR(res->phy_ahb_reset))
> -		return PTR_ERR(res->phy_ahb_reset);
>  
> -	return 0;
> +	return PTR_ERR_OR_ZERO(res->phy_ahb_reset);
>  }
>  
>  static void qcom_pcie_deinit_2_4_0(struct qcom_pcie *pcie)

My opinion doesn't carry any weight, but IMO using PTR_ERR_OR_ZERO instead
of PTR_ERR breaks the symmetry of the previous operations.

It seems to give the last operation more importance than the previous ones,
which I don't find desirable.

Regards.

  reply	other threads:[~2019-05-27 12:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-25  8:57 [PATCH] drivers/pci/controller: fix warning PTR_ERR_OR_ZERO can be used Hariprasad Kelam
2019-05-27 12:40 ` Marc Gonzalez [this message]
2019-05-27 14:09 ` Thierry Reding
2019-05-31 14:47   ` Lorenzo Pieralisi

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=085da143-9d13-8741-9f6c-489754fef9f6@free.fr \
    --to=marc.w.gonzalez@free.fr \
    --cc=bjorn.andersson@linaro.org \
    --cc=hariprasad.kelam@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=stanimir.varbanov@linaro.org \
    /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).