Skip to contentSkip to conversation

PCI: Use PCI_STD_NUM_BARS instead of 6

PATCH Applied Ilpo Järvinen 3 participants 3 messages Apr 16, 2025 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: Use PCI_STD_NUM_BARS instead of 6

pci_read_bases() is given literal 6 that means PCI_STD_NUM_BARS. Replace the literal with the define to annotate the code better.

---
 drivers/pci/probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/probe.c +1 -1
index 364fa2a514f8..08971fca0819 100644
@@ -2058,7 +2058,7 @@ int pci_setup_device(struct pci_dev *dev)
 		if (class == PCI_CLASS_BRIDGE_PCI)
 			goto bad;
 		pci_read_irq(dev);
-		pci_read_bases(dev, 6, PCI_ROM_ADDRESS);
+		pci_read_bases(dev, PCI_STD_NUM_BARS, PCI_ROM_ADDRESS);
 
 		pci_subsystem_ids(dev, &dev->subsystem_vendor, &dev->subsystem_device);
 

base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8

Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Ilpo Järvinen

pci_read_bases() is given literal 6 that means PCI_STD_NUM_BARS. Replace the literal with the define to annotate the code better.

---
 drivers/pci/probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/probe.c +1 -1
index 364fa2a514f8..08971fca0819 100644
@@ -2058,7 +2058,7 @@ int pci_setup_device(struct pci_dev *dev)
 		if (class == PCI_CLASS_BRIDGE_PCI)
 			goto bad;
 		pci_read_irq(dev);
-		pci_read_bases(dev, 6, PCI_ROM_ADDRESS);
+		pci_read_bases(dev, PCI_STD_NUM_BARS, PCI_ROM_ADDRESS);
 
 		pci_subsystem_ids(dev, &dev->subsystem_vendor, &dev->subsystem_device);
 
Quoted 4 lines

base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8

Signature · 1 line
2.39.5
#2 lore raw
In reply to Ilpo Järvinen
Quoted 4 lines · Ilpo Järvinen

pci_read_bases() is given literal 6 that means PCI_STD_NUM_BARS. Replace the literal with the define to annotate the code better.

Applied to pci/enumeration for v6.16, thanks!

Quoted 22 lines
---
 drivers/pci/probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/probe.c +1 -1
index 364fa2a514f8..08971fca0819 100644
@@ -2058,7 +2058,7 @@ int pci_setup_device(struct pci_dev *dev)
 		if (class == PCI_CLASS_BRIDGE_PCI)
 			goto bad;
 		pci_read_irq(dev);
-		pci_read_bases(dev, 6, PCI_ROM_ADDRESS);
+		pci_read_bases(dev, PCI_STD_NUM_BARS, PCI_ROM_ADDRESS);
 
 		pci_subsystem_ids(dev, &dev->subsystem_vendor, &dev->subsystem_device);
 

base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8

Signature · 1 line
2.39.5