From a7947b6366a660d4d655371fe6bc96315097c06d Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Thu, 9 Apr 2020 13:30:17 +0200 Subject: MdeModulePkg/NonDiscoverablePciDeviceDxe: use standard PCI_MAX_BAR macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NonDiscoverablePciDeviceDxe currently #defines the module-internal PCI_MAX_BARS macro, with value 6 (and type "int"). Remove this private macro definition, and adopt PCI_MAX_BAR from "MdePkg/Include/IndustryStandard/Pci22.h". Both the value and the type remain unchanged (the standard PCI_MAX_BAR macro expands to 0x0006). "NonDiscoverablePciDeviceIo.h" gets the definition of PCI_MAX_BAR via its existent #include directive. Build-tested only. Cc: Ard Biesheuvel Cc: Hao A Wu Cc: Jian J Wang Cc: Philippe Mathieu-Daudé Cc: Ray Ni Signed-off-by: Laszlo Ersek Message-Id: <20200409113017.18233-1-lersek@redhat.com> Reviewed-by: Ard Biesheuvel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ray Ni --- .../Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c | 4 ++-- .../Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'MdeModulePkg/Bus') diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c index c3e83003a0..a40c1a9593 100644 --- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c +++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c @@ -1679,8 +1679,8 @@ InitializePciIoProtocol ( ASSERT (Desc->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR); ASSERT (Desc->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM); - if (Idx >= PCI_MAX_BARS || - (Idx == PCI_MAX_BARS - 1 && Desc->AddrSpaceGranularity == 64)) { + if (Idx >= PCI_MAX_BAR || + (Idx == PCI_MAX_BAR - 1 && Desc->AddrSpaceGranularity == 64)) { DEBUG ((DEBUG_ERROR, "%a: resource count exceeds number of emulated BARs\n", __FUNCTION__)); diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.h b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.h index 15541c2811..3e6df3bebd 100644 --- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.h +++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.h @@ -36,8 +36,6 @@ #define PCI_ID_VENDOR_UNKNOWN 0xffff #define PCI_ID_DEVICE_DONTCARE 0x0000 -#define PCI_MAX_BARS 6 - extern EFI_CPU_ARCH_PROTOCOL *mCpu; typedef struct { -- cgit v1.2.3