]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PCI: endpoint: Replace magic number '6' by PCI_STD_NUM_BARS
authorRick Wertenbroek <rick.wertenbroek@gmail.com>
Thu, 12 Dec 2024 16:25:47 +0000 (17:25 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 12 Dec 2024 18:59:11 +0000 (12:59 -0600)
Replace the constant "6" by PCI_STD_NUM_BARS, as defined in
include/uapi/linux/pci_regs.h:

  #define PCI_STD_NUM_BARS       6       /* Number of standard BARs */

Link: https://lore.kernel.org/r/20241212162547.225880-1-rick.wertenbroek@gmail.com
Signed-off-by: Rick Wertenbroek <rick.wertenbroek@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
include/linux/pci-epf.h

index 18a3aeb62ae4e652249cf5b7ae5e119e62784e02..ee6156bcbbd05ed01b572191732e7d812d1d7a32 100644 (file)
@@ -157,7 +157,7 @@ struct pci_epf {
        struct device           dev;
        const char              *name;
        struct pci_epf_header   *header;
-       struct pci_epf_bar      bar[6];
+       struct pci_epf_bar      bar[PCI_STD_NUM_BARS];
        u8                      msi_interrupts;
        u16                     msix_interrupts;
        u8                      func_no;
@@ -174,7 +174,7 @@ struct pci_epf {
        /* Below members are to attach secondary EPC to an endpoint function */
        struct pci_epc          *sec_epc;
        struct list_head        sec_epc_list;
-       struct pci_epf_bar      sec_epc_bar[6];
+       struct pci_epf_bar      sec_epc_bar[PCI_STD_NUM_BARS];
        u8                      sec_epc_func_no;
        struct config_group     *group;
        unsigned int            is_bound;