]> asedeno.scripts.mit.edu Git - linux.git/commit
PCI: Add PCI_STD_NUM_BARS for the number of standard BARs
authorDenis Efremov <efremov@linux.com>
Fri, 27 Sep 2019 23:43:08 +0000 (02:43 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 14 Oct 2019 15:22:26 +0000 (10:22 -0500)
commitc9c13ba428ef90a9b408a6cdf874e14ab5754516
tree3a4f26d131bf0399f4b30225ea1495852cc79621
parent7608158df3ed87a5c938c4a0b91f5b11101a9be1
PCI: Add PCI_STD_NUM_BARS for the number of standard BARs

Code that iterates over all standard PCI BARs typically uses
PCI_STD_RESOURCE_END.  However, that requires the unusual test
"i <= PCI_STD_RESOURCE_END" rather than something the typical
"i < PCI_STD_NUM_BARS".

Add a definition for PCI_STD_NUM_BARS and change loops to use the more
idiomatic C style to help avoid fencepost errors.

Link: https://lore.kernel.org/r/20190927234026.23342-1-efremov@linux.com
Link: https://lore.kernel.org/r/20190927234308.23935-1-efremov@linux.com
Link: https://lore.kernel.org/r/20190916204158.6889-3-efremov@linux.com
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Sebastian Ott <sebott@linux.ibm.com> # arch/s390/
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> # video/fbdev/
Acked-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com> # pci/controller/dwc/
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com> # scsi/pm8001/
Acked-by: Martin K. Petersen <martin.petersen@oracle.com> # scsi/pm8001/
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # memstick/
46 files changed:
arch/alpha/kernel/pci-sysfs.c
arch/s390/include/asm/pci.h
arch/s390/include/asm/pci_clp.h
arch/s390/pci/pci.c
arch/s390/pci/pci_clp.c
arch/x86/pci/common.c
arch/x86/pci/intel_mid_pci.c
drivers/ata/pata_atp867x.c
drivers/ata/sata_nv.c
drivers/memstick/host/jmb38x_ms.c
drivers/misc/pci_endpoint_test.c
drivers/net/ethernet/intel/e1000/e1000.h
drivers/net/ethernet/intel/e1000/e1000_main.c
drivers/net/ethernet/intel/ixgb/ixgb.h
drivers/net/ethernet/intel/ixgb/ixgb_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
drivers/pci/controller/dwc/pci-dra7xx.c
drivers/pci/controller/dwc/pci-layerscape-ep.c
drivers/pci/controller/dwc/pcie-artpec6.c
drivers/pci/controller/dwc/pcie-designware-plat.c
drivers/pci/controller/dwc/pcie-designware.h
drivers/pci/controller/pci-hyperv.c
drivers/pci/endpoint/functions/pci-epf-test.c
drivers/pci/pci-sysfs.c
drivers/pci/pci.c
drivers/pci/proc.c
drivers/pci/quirks.c
drivers/rapidio/devices/tsi721.c
drivers/scsi/pm8001/pm8001_hwi.c
drivers/scsi/pm8001/pm8001_init.c
drivers/staging/gasket/gasket_constants.h
drivers/staging/gasket/gasket_core.c
drivers/staging/gasket/gasket_core.h
drivers/tty/serial/8250/8250_pci.c
drivers/usb/core/hcd-pci.c
drivers/usb/host/pci-quirks.c
drivers/vfio/pci/vfio_pci.c
drivers/vfio/pci/vfio_pci_config.c
drivers/vfio/pci/vfio_pci_private.h
drivers/video/fbdev/core/fbmem.c
drivers/video/fbdev/efifb.c
include/linux/pci-epc.h
include/linux/pci.h
include/uapi/linux/pci_regs.h
lib/devres.c