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>
\r
FreePool (Descriptors);\r
\r
- switch (Status) {\r
- case EFI_SUCCESS:\r
- BusPadding = TRUE;\r
- break;\r
-\r
- case EFI_NOT_FOUND:\r
- //\r
- // no bus number padding requested\r
- //\r
- break;\r
-\r
- default:\r
- return Status;\r
+ if (!EFI_ERROR (Status)) {\r
+ BusPadding = TRUE;\r
+ } else if (Status != EFI_NOT_FOUND) {\r
+ //\r
+ // EFI_NOT_FOUND is not a real error. It indicates no bus number padding requested.\r
+ //\r
+ return Status;\r
}\r
}\r
}\r