From: Ruiyu Ni Date: Tue, 9 Jan 2018 05:52:47 +0000 (+0800) Subject: MdeModulePkg/PciBus: Change switch-case to if-else to fix EBC build X-Git-Tag: edk2-stable201903~2639 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=ada385843b94067921dd2103e7daf3846df93bcc MdeModulePkg/PciBus: Change switch-case to if-else to fix EBC build EBC compiler doesn't treat EFI_xxx as constant due to these macros are UINT64 type in 64bit env and UINT32 type in 32bit env. So it reports error when "case EFI_xxx" is used. The patch changes to use if-else to fix EBC build failure. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Reviewed-by: Laszlo Ersek --- diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c index dc1086606f..976496379a 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c @@ -1154,19 +1154,13 @@ PciScanBus ( FreePool (Descriptors); - switch (Status) { - case EFI_SUCCESS: - BusPadding = TRUE; - break; - - case EFI_NOT_FOUND: - // - // no bus number padding requested - // - break; - - default: - return Status; + if (!EFI_ERROR (Status)) { + BusPadding = TRUE; + } else if (Status != EFI_NOT_FOUND) { + // + // EFI_NOT_FOUND is not a real error. It indicates no bus number padding requested. + // + return Status; } } }