Re: [PATCH v3 01/11] PCI: Propagate FLR return values to callers
From: Nicolin Chen
Date: Thu Apr 23 2026 - 00:39:55 EST
On Wed, Apr 22, 2026 at 02:13:49PM +0800, Baolu Lu wrote:
> On 4/17/26 07:28, Nicolin Chen wrote:
> > @@ -4060,7 +4061,7 @@ static int reset_chelsio_generic_dev(struct pci_dev *dev, bool probe)
> > PCI_MSIX_FLAGS_ENABLE |
> > PCI_MSIX_FLAGS_MASKALL);
> > - pcie_flr(dev);
> > + ret = pcie_flr(dev);
>
> It makes more sense to return early here on failure. There is no need to
> perform the subsequent steps if pcie_flr() fails. Would something like
> the following work?
[...]
> @@ -4060,7 +4061,9 @@ static int reset_chelsio_generic_dev(struct pci_dev
> *dev, bool probe)
> PCI_MSIX_FLAGS_ENABLE |
> PCI_MSIX_FLAGS_MASKALL);
>
> - pcie_flr(dev);
> + ret = pcie_flr(dev);
> + if (ret)
> + return ret;
Yea, I was a bit worried to change the behavior, skipping the rest
part. But that's probably the right thing to do.
Thanks
Nicolin