From fb4bea551e5b7e16e54676bca3d1ccde65f57c77 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Fri, 5 Oct 2018 14:35:25 +0800 Subject: MdePkg: Correct condition check for AcpiExp text format REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1226 According to UEFI Spec, for ACPI Expanded Device Path, when HIDSTR=empty, CIDSTR=empty, UID STR!=empty, the ACPI Expanded Device Path node can be displayed as AcpiExp(HID,CID,UIDSTR) format. And if UID is 0 and UIDSTR is empty, then use AcpiEx format. This patch is to correct the condition check to follow UEFI Spec when convert the device path node to the AcpiExp text format. Cc: Ruiyu Ni Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Ruiyu Ni --- MdePkg/Library/UefiDevicePathLib/DevicePathToText.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c index 1c08a3ec2f..8e5efba1e8 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c @@ -455,7 +455,7 @@ DevPathToTextAcpiEx ( (AcpiEx->CID >> 16) & 0xFFFF ); - if ((*HIDStr == '\0') && (*CIDStr == '\0') && (AcpiEx->UID == 0)) { + if ((*HIDStr == '\0') && (*CIDStr == '\0') && (*UIDStr != '\0')) { // // use AcpiExp() // -- cgit v1.2.3