summaryrefslogtreecommitdiff
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2025-06-10 13:58:20 +0300
committerBjorn Helgaas <bhelgaas@google.com>2025-08-11 15:00:51 -0500
commitc763fae8c4231e426033f62c21be60db4b6659a9 (patch)
treed0da1090a40c5d16cea925873898d8ea3e1c1eb5 /drivers/pci/probe.c
parentaa84931ba7f989c263a79a3a962524b5830d0e64 (diff)
PCI: Clean up pci_scan_child_bus_extend() loop
pci_scan_child_bus_extend() open-codes device number iteration in the for loop. Convert to use PCI_DEVFN() and add PCI_MAX_NR_DEVS (there seems to be no pre-existing define for this purpose). Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Link: https://patch.msgid.link/20250610105820.7126-3-ilpo.jarvinen@linux.intel.com
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index b06f0d19f9a7..591aee60e3d0 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -3046,14 +3046,14 @@ static unsigned int pci_scan_child_bus_extend(struct pci_bus *bus,
{
unsigned int used_buses, normal_bridges = 0, hotplug_bridges = 0;
unsigned int start = bus->busn_res.start;
- unsigned int devfn, cmax, max = start;
+ unsigned int devnr, cmax, max = start;
struct pci_dev *dev;
dev_dbg(&bus->dev, "scanning bus\n");
/* Go find them, Rover! */
- for (devfn = 0; devfn < 256; devfn += 8)
- pci_scan_slot(bus, devfn);
+ for (devnr = 0; devnr < PCI_MAX_NR_DEVS; devnr++)
+ pci_scan_slot(bus, PCI_DEVFN(devnr, 0));
/* Reserve buses for SR-IOV capability */
used_buses = pci_iov_bus_range(bus);