ARM_PCI_CFG_SIZE has the same value as PCI_CFG_SIZE. The pci driver uses PCI_CFG_SIZE and arm uses ARM_PCI_CFG_SIZE when generating the pci DT node. Having two defines with the same value is confusing, and can lead to bugs if one define is changed and the other isn't. So replace all instances of ARM_PCI_CFG_SIZE with PCI_CFG_SIZE. Signed-off-by: Alexandru Elisei <alexandru.elisei@xxxxxxx> --- arm/include/arm-common/kvm-arch.h | 7 ++++--- arm/pci.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arm/include/arm-common/kvm-arch.h b/arm/include/arm-common/kvm-arch.h index 965978d7cfb5..f8f6b8f98c96 100644 --- a/arm/include/arm-common/kvm-arch.h +++ b/arm/include/arm-common/kvm-arch.h @@ -5,6 +5,8 @@ #include <linux/const.h> #include <linux/types.h> +#include "kvm/pci.h" + #include "arm-common/gic.h" #define ARM_IOPORT_AREA _AC(0x0000000000000000, UL) @@ -23,13 +25,12 @@ #define ARM_IOPORT_SIZE (ARM_MMIO_AREA - ARM_IOPORT_AREA) #define ARM_VIRTIO_MMIO_SIZE (ARM_AXI_AREA - (ARM_MMIO_AREA + ARM_GIC_SIZE)) -#define ARM_PCI_CFG_SIZE (1ULL << 24) #define ARM_PCI_MMIO_SIZE (ARM_MEMORY_AREA - \ - (ARM_AXI_AREA + ARM_PCI_CFG_SIZE)) + (ARM_AXI_AREA + PCI_CFG_SIZE)) #define KVM_IOPORT_AREA ARM_IOPORT_AREA #define KVM_PCI_CFG_AREA ARM_AXI_AREA -#define KVM_PCI_MMIO_AREA (KVM_PCI_CFG_AREA + ARM_PCI_CFG_SIZE) +#define KVM_PCI_MMIO_AREA (KVM_PCI_CFG_AREA + PCI_CFG_SIZE) #define KVM_VIRTIO_MMIO_AREA ARM_MMIO_AREA #define KVM_IOEVENTFD_HAS_PIO 0 diff --git a/arm/pci.c b/arm/pci.c index 557cfa98938d..1a2fc2688c9e 100644 --- a/arm/pci.c +++ b/arm/pci.c @@ -33,7 +33,7 @@ void pci__generate_fdt_nodes(void *fdt) u32 bus_range[] = { cpu_to_fdt32(0), cpu_to_fdt32(1), }; /* Configuration Space */ u64 cfg_reg_prop[] = { cpu_to_fdt64(KVM_PCI_CFG_AREA), - cpu_to_fdt64(ARM_PCI_CFG_SIZE), }; + cpu_to_fdt64(PCI_CFG_SIZE), }; /* Describe the memory ranges */ struct of_pci_ranges_entry ranges[] = { { -- 2.7.4