summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-01-09 13:52:47 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-01-10 10:28:30 +0800
commitada385843b94067921dd2103e7daf3846df93bcc (patch)
tree9c696cebf277d637a4e10130c9c0ee8ffe7a2d98 /MdeModulePkg/Bus
parent3143144ba55bc32dd15312fcaf08f41f83f92d96 (diff)
downloadedk2-ada385843b94067921dd2103e7daf3846df93bcc.zip
edk2-ada385843b94067921dd2103e7daf3846df93bcc.tar.gz
edk2-ada385843b94067921dd2103e7daf3846df93bcc.tar.bz2
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 <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c
index dc10866..9764963 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;
}
}
}