[edk2-devel] [PATCH edk2-platforms v3 03/10] Silicon/NXP/PciHostBridgeLib: Fix compilation with MDEPKG_NDEBUG flag

Pankaj Bansal pankaj.bansal at nxp.com
Fri May 29 05:51:42 UTC 2020


From: Pankaj Bansal <pankaj.bansal at nxp.com>

when MDEPKG_NDEBUG flag is enabled, RELEASE build fails with this error:

error: mPciHostBridgeLibAcpiAddressSpaceTypeStr defined but not used
[-Werror=unused-variable]

Fix this error by protecting mPciHostBridgeLibAcpiAddressSpaceTypeStr
with MDEPKG_NDEBUG macro.

Suggested-by: Leif Lindholm <leif at nuviainc.com>
Signed-off-by: Pankaj Bansal <pankaj.bansal at nxp.com>
---

Notes:
    V3:
    - New commit

 Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c
index 549f4fa133fb..e5309a4f4248 100644
--- a/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/Silicon/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -167,11 +167,13 @@ STATIC CONST EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mEfiPciRootBridgeDevicePath[] = {
   }
 };
 
+#ifndef MDEPKG_NDEBUG
 STATIC
 GLOBAL_REMOVE_IF_UNREFERENCED
 CHAR16 *mPciHostBridgeLibAcpiAddressSpaceTypeStr[] = {
   L"Mem", L"I/O", L"Bus"
 };
+#endif
 
 #define PCI_ALLOCATION_ATTRIBUTES       EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM | \
                                         EFI_PCI_HOST_BRIDGE_MEM64_DECODE
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#60431): https://edk2.groups.io/g/devel/message/60431
Mute This Topic: https://groups.io/mt/74538274/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list