]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
MdePkg: Handle AcpiExp device path when optional para is not specified
[mirror_edk2.git] / MdePkg / Library / UefiDevicePathLib / DevicePathToText.c
index 7ad9eadf6c11e3d161ec2dba3c67ed0e95deccda..cdcdb3623ae89c1f84da9a6a26a9091fe5a1c63f 100644 (file)
@@ -480,13 +480,22 @@ DevPathToTextAcpiEx (
     //\r
     // use AcpiExp()\r
     //\r
-    UefiDevicePathLibCatPrint (\r
-      Str,\r
-      L"AcpiExp(%s,%s,%a)",\r
-      HIDText,\r
-      CIDText,\r
-      UIDStr\r
-      );\r
+    if (AcpiEx->CID == 0) {\r
+      UefiDevicePathLibCatPrint (\r
+        Str,\r
+        L"AcpiExp(%s,0,%a)",\r
+        HIDText,\r
+        UIDStr\r
+       );\r
+    } else {\r
+      UefiDevicePathLibCatPrint (\r
+        Str,\r
+        L"AcpiExp(%s,%s,%a)",\r
+        HIDText,\r
+        CIDText,\r
+        UIDStr\r
+       );\r
+    }\r
   } else {\r
     if (AllowShortcuts) {\r
       //\r