]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/NonDiscoverablePciDeviceDxe: use standard PCI_MAX_BAR macro
authorLaszlo Ersek <lersek@redhat.com>
Thu, 9 Apr 2020 11:30:17 +0000 (13:30 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 16 Apr 2020 19:53:46 +0000 (19:53 +0000)
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 <IndustryStandard/Pci.h> directive.

Build-tested only.

Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200409113017.18233-1-lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.h

index c3e83003a01c5e79c7b04e82d84722a2bd885ad1..a40c1a959350f1ccc73c909c4de14a3b194c5f0d 100644 (file)
@@ -1679,8 +1679,8 @@ InitializePciIoProtocol (
     ASSERT (Desc->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR);\r
     ASSERT (Desc->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM);\r
 \r
-    if (Idx >= PCI_MAX_BARS ||\r
-        (Idx == PCI_MAX_BARS - 1 && Desc->AddrSpaceGranularity == 64)) {\r
+    if (Idx >= PCI_MAX_BAR ||\r
+        (Idx == PCI_MAX_BAR - 1 && Desc->AddrSpaceGranularity == 64)) {\r
       DEBUG ((DEBUG_ERROR,\r
         "%a: resource count exceeds number of emulated BARs\n",\r
         __FUNCTION__));\r
index 15541c281153d3924b4750808a4e7fa162a6d962..3e6df3bebdd754e98729e5c436cd275b86516465 100644 (file)
@@ -36,8 +36,6 @@
 #define PCI_ID_VENDOR_UNKNOWN         0xffff\r
 #define PCI_ID_DEVICE_DONTCARE        0x0000\r
 \r
-#define PCI_MAX_BARS                  6\r
-\r
 extern EFI_CPU_ARCH_PROTOCOL      *mCpu;\r
 \r
 typedef struct {\r