linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: linux-pci@vger.kernel.org, "Bjorn Helgaas" <helgaas@kernel.org>,
	"Andi Shyti" <andi.shyti@kernel.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Toan Le" <toan@os.amperecomputing.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 7/8] PCI: xgene: Do PCI error check on own line
Date: Tue, 29 Aug 2023 11:05:32 -0500	[thread overview]
Message-ID: <CAL_JsqLELe91os89A1bOG+RPQpdFz0u_SyHx19zhkU19sPH7jg@mail.gmail.com> (raw)
In-Reply-To: <20230827133705.12991-8-ilpo.jarvinen@linux.intel.com>

On Sun, Aug 27, 2023 at 8:37 AM Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com> wrote:
>
> Instead of a if condition with a line split, use the usual error
> handling pattern with a separate variable to improve readability.
>
> No functional changes intended.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
>  drivers/pci/controller/pci-xgene.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c
> index 887b4941ff32..b7f338de160b 100644
> --- a/drivers/pci/controller/pci-xgene.c
> +++ b/drivers/pci/controller/pci-xgene.c
> @@ -163,9 +163,10 @@ static int xgene_pcie_config_read32(struct pci_bus *bus, unsigned int devfn,
>                                     int where, int size, u32 *val)
>  {
>         struct xgene_pcie *port = pcie_bus_to_port(bus);
> +       int ret;
>
> -       if (pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val) !=
> -           PCIBIOS_SUCCESSFUL)
> +       ret = pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val);
> +       if (ret != PCIBIOS_SUCCESSFUL)

Long term I think we want to replace these error codes with standard
linux ones. As PCIBIOS_SUCCESSFUL is 0, I would change this to just:

if (pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val))
    return PCIBIOS_DEVICE_NOT_FOUND;


>                 return PCIBIOS_DEVICE_NOT_FOUND;
>
>         /*
> --
> 2.30.2
>

  reply	other threads:[~2023-08-29 16:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-27 13:36 [PATCH v2 0/8] PCI/treewide: Cleanup/streamline PCI error code handling Ilpo Järvinen
2023-08-27 13:36 ` [PATCH v2 1/8] alpha: Streamline convoluted PCI error handling Ilpo Järvinen
2023-08-27 13:36 ` [PATCH v2 2/8] MIPS: TXx9: Do PCI error checks on own line Ilpo Järvinen
2023-08-28  9:10   ` Thomas Bogendoerfer
2023-08-27 13:37 ` [PATCH v2 3/8] sh: pci: Do PCI error check " Ilpo Järvinen
2023-08-27 13:37 ` [PATCH v2 4/8] atm: iphase: Do PCI error checks " Ilpo Järvinen
2023-08-27 13:37 ` [PATCH v2 5/8] I2C: ali15x3: " Ilpo Järvinen
2023-08-28 22:10   ` Andi Shyti
2023-08-30 19:18   ` Wolfram Sang
2023-08-27 13:37 ` [PATCH v2 6/8] PCI: Do error check on own line to split long if conditions Ilpo Järvinen
2023-08-27 13:37 ` [PATCH v2 7/8] PCI: xgene: Do PCI error check on own line Ilpo Järvinen
2023-08-29 16:05   ` Rob Herring [this message]
2023-08-29 16:14     ` Ilpo Järvinen
2023-08-29 16:23       ` Ilpo Järvinen
2023-08-27 13:37 ` [PATCH v2 8/8] scsi: ipr: Do PCI error checks " Ilpo Järvinen

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=CAL_JsqLELe91os89A1bOG+RPQpdFz0u_SyHx19zhkU19sPH7jg@mail.gmail.com \
    --to=robh@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=philmd@linaro.org \
    --cc=toan@os.amperecomputing.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).