Skip to content

Commit 910ed62

Browse files
ij-intelbjorn-helgaas
authored andcommitted
PCI: xgene: Do PCI error check on own line & keep return value
Instead of an "if" condition with a line split, use the usual error handling pattern with a separate variable to improve readability. pci_generic_config_read32() already returns either PCIBIOS_SUCCESSFUL or PCIBIOS_DEVICE_NOT_FOUND so it is enough to simply return its return value when ret != PCIBIOS_SUCCESSFUL. No functional changes intended. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent d15f180 commit 910ed62

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/pci/controller/pci-xgene.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,11 @@ static int xgene_pcie_config_read32(struct pci_bus *bus, unsigned int devfn,
163163
int where, int size, u32 *val)
164164
{
165165
struct xgene_pcie *port = pcie_bus_to_port(bus);
166+
int ret;
166167

167-
if (pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val) !=
168-
PCIBIOS_SUCCESSFUL)
169-
return PCIBIOS_DEVICE_NOT_FOUND;
168+
ret = pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val);
169+
if (ret != PCIBIOS_SUCCESSFUL)
170+
return ret;
170171

171172
/*
172173
* The v1 controller has a bug in its Configuration Request Retry

0 commit comments

Comments
 (0)