D Denis Efremov #
Message details and related content
Code that iterates over all standard PCI BARs typically uses
PCI_STD_RESOURCE_END, but this is error-prone because it requires
"i <= PCI_STD_RESOURCE_END" rather than something like
"i < PCI_STD_NUM_BARS". We could add such a definition and use it the same
way PCI_SRIOV_NUM_BARS is used. The patchset also replaces constant (6)
with new define PCI_STD_NUM_BARS where appropriate and removes local
declarations for the number of PCI BARs.
Changes in v3:
- Updated commits description.
- Refactored "< PCI_ROM_RESOURCE" with "< PCI_STD_NUM_BARS" in loops.
- Refactored "<= BAR_5" with "< PCI_STD_NUM_BARS" in loops.
- Removed local define GASKET_NUM_BARS.
- Removed local define PCI_NUM_BAR_RESOURCES.
Changes in v2:
- Reversed checks in pci_iomap_range,pci_iomap_wc_range.
- Refactored loops in vfio_pci to keep PCI_STD_RESOURCES.
- Added 2 new patches to replace the magic constant with new define.
- Splitted net patch in v1 to separate stmmac and dwc-xlgmac patches.
Denis Efremov (26):
PCI: Add define for the number of standard PCI BARs
PCI: hv: Use PCI_STD_NUM_BARS
PCI: dwc: Use PCI_STD_NUM_BARS
PCI: endpoint: Use PCI_STD_NUM_BARS
misc: pci_endpoint_test: Use PCI_STD_NUM_BARS
s390/pci: Use PCI_STD_NUM_BARS
x86/PCI: Loop using PCI_STD_NUM_BARS
alpha/PCI: Use PCI_STD_NUM_BARS
ia64: Use PCI_STD_NUM_BARS
stmmac: pci: Loop using PCI_STD_NUM_BARS
net: dwc-xlgmac: Loop using PCI_STD_NUM_BARS
ixgb: use PCI_STD_NUM_BARS
e1000: Use PCI_STD_NUM_BARS
rapidio/tsi721: Loop using PCI_STD_NUM_BARS
efifb: Loop using PCI_STD_NUM_BARS
fbmem: use PCI_STD_NUM_BARS
vfio_pci: Loop using PCI_STD_NUM_BARS
scsi: pm80xx: Use PCI_STD_NUM_BARS