]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
Code scrub for DevicePathDxe driver.
[mirror_edk2.git] / MdeModulePkg / Universal / DevicePathDxe / DevicePathToText.c
index 0ba2a25618e2687b7f9ea95da94c11e54ee1607d..a1d560cfd536b045601f458add37ae5e3e62ff0b 100644 (file)
@@ -14,25 +14,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "DevicePath.h"\r
 \r
-STATIC\r
+/**\r
+  Function unpacks a device path data structure so that all the nodes of a device path\r
+  are naturally aligned.\r
+\r
+  @param DevPath         A pointer to a device path data structure\r
+\r
+  @return If the memory for the device path is successfully allocated, then a pointer to the\r
+          new device path is returned.  Otherwise, NULL is returned.\r
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 UnpackDevicePath (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevPath\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Function unpacks a device path data structure so that all the nodes of a device path \r
-    are naturally aligned.\r
-\r
-  Arguments:\r
-    DevPath        - A pointer to a device path data structure\r
-\r
-  Returns:\r
-    If the memory for the device path is successfully allocated, then a pointer to the \r
-    new device path is returned.  Otherwise, NULL is returned.\r
-\r
---*/\r
 {\r
   CONST EFI_DEVICE_PATH_PROTOCOL  *Src;\r
   EFI_DEVICE_PATH_PROTOCOL  *Dest;\r
@@ -89,39 +84,32 @@ UnpackDevicePath (
   return NewPath;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Adjusts the size of a previously allocated buffer.\r
+\r
+  @param OldPool         A pointer to the buffer whose size is being adjusted.\r
+  @param OldSize         The size of the current buffer.\r
+  @param NewSize         The size of the new buffer.\r
+\r
+  @return A pointer to the new buffer or NULL if allocation fails.\r
+\r
+**/\r
 VOID *\r
 ReallocatePool (\r
   IN VOID                 *OldPool,\r
   IN UINTN                OldSize,\r
   IN UINTN                NewSize\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Adjusts the size of a previously allocated buffer.\r
-\r
-  Arguments:\r
-    OldPool               - A pointer to the buffer whose size is being adjusted.\r
-    OldSize               - The size of the current buffer.\r
-    NewSize               - The size of the new buffer.\r
-\r
-  Returns:\r
-    EFI_SUCEESS           - The requested number of bytes were allocated.\r
-    EFI_OUT_OF_RESOURCES  - The pool requested could not be allocated.\r
-    EFI_INVALID_PARAMETER - The buffer was invalid.\r
-\r
---*/\r
 {\r
   VOID  *NewPool;\r
 \r
   NewPool = NULL;\r
-  if (NewSize) {\r
+  if (NewSize != 0) {\r
     NewPool = AllocateZeroPool (NewSize);\r
   }\r
 \r
-  if (OldPool) {\r
-    if (NewPool) {\r
+  if (OldPool != NULL) {\r
+    if (NewPool != NULL) {\r
       CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);\r
     }\r
 \r
@@ -131,30 +119,26 @@ ReallocatePool (
   return NewPool;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Concatenates a formatted unicode string to allocated pool. The caller must\r
+  free the resulting buffer.\r
+\r
+  @param Str             Tracks the allocated pool, size in use, and\r
+                         amount of pool allocated.\r
+  @param Fmt             The format string\r
+  @param ...             Variable arguments based on the format string.\r
+\r
+  @return Allocated buffer with the formatted string printed in it.\r
+          The caller must free the allocated buffer. The buffer\r
+          allocation is not packed.\r
+\r
+**/\r
 CHAR16 *\r
 CatPrint (\r
   IN OUT POOL_PRINT   *Str,\r
   IN CHAR16           *Fmt,\r
   ...\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Concatenates a formatted unicode string to allocated pool.  \r
-    The caller must free the resulting buffer.\r
-\r
-  Arguments:\r
-    Str         - Tracks the allocated pool, size in use, and \r
-                  amount of pool allocated.\r
-    Fmt         - The format string\r
-\r
-  Returns:\r
-    Allocated buffer with the formatted string printed in it.  \r
-    The caller must free the allocated buffer.   The buffer\r
-    allocation is not packed.\r
-\r
---*/\r
 {\r
   UINT16  *AppendStr;\r
   VA_LIST Args;\r
@@ -173,7 +157,7 @@ CatPrint (
     Str->Str  = AllocateZeroPool (Size);\r
     ASSERT (Str->Str != NULL);\r
   } else {\r
-    Size = StrSize (AppendStr)  - sizeof (UINT16);\r
+    Size = StrSize (AppendStr) - sizeof (UINT16);\r
     Size = Size + StrSize (Str->Str);\r
     Str->Str = ReallocatePool (\r
                 Str->Str,\r
@@ -193,7 +177,19 @@ CatPrint (
   return Str->Str;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a PCI device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextPci (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -208,7 +204,19 @@ DevPathToTextPci (
   CatPrint (Str, L"Pci(0x%x,0x%x)", Pci->Device, Pci->Function);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a PC Card device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextPccard (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -223,7 +231,19 @@ DevPathToTextPccard (
   CatPrint (Str, L"PcCard(0x%x)", Pccard->FunctionNumber);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Memory Map device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextMemMap (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -244,7 +264,19 @@ DevPathToTextMemMap (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Vendor device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextVendor (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -316,9 +348,9 @@ DevPathToTextVendor (
           CatPrint (\r
             Str,\r
             L"%s,%s,%s,",\r
-            (Info & (0x1 << 4)) ? L"SATA" : L"SAS",\r
-            (Info & (0x1 << 5)) ? L"External" : L"Internal",\r
-            (Info & (0x1 << 6)) ? L"Expanded" : L"Direct"\r
+            ((Info & (0x1 << 4)) != 0) ? L"SATA" : L"SAS",\r
+            ((Info & (0x1 << 5)) != 0) ? L"External" : L"Internal",\r
+            ((Info & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct"\r
             );\r
           if ((Info & 0x0f) == 1) {\r
             CatPrint (Str, L"0,");\r
@@ -359,7 +391,19 @@ DevPathToTextVendor (
   CatPrint (Str, L")");\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Controller device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextController (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -378,7 +422,19 @@ DevPathToTextController (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a ACPI device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextAcpi (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -421,11 +477,17 @@ DevPathToTextAcpi (
   }\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts EISA identification to string.\r
+\r
+  @param EisaId        The input EISA identification.\r
+  @param Text          A pointer to the output string.\r
+\r
+**/\r
 VOID\r
 EisaIdToText (\r
   IN UINT32         EisaId,\r
-  IN OUT CHAR16    *Text\r
+  IN OUT CHAR16     *Text\r
   )\r
 {\r
   CHAR16 PnpIdStr[17];\r
@@ -446,7 +508,19 @@ EisaIdToText (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a ACPI extended HID device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextAcpiEx (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -518,7 +592,19 @@ DevPathToTextAcpiEx (
   }\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a ACPI address device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextAcpiAdr (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -543,7 +629,19 @@ DevPathToTextAcpiAdr (
   CatPrint (Str, L")");\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a ATAPI device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextAtapi (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -569,7 +667,19 @@ DevPathToTextAtapi (
   }\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a SCSI device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextScsi (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -584,7 +694,19 @@ DevPathToTextScsi (
   CatPrint (Str, L"Scsi(0x%x,0x%x)", Scsi->Pun, Scsi->Lun);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Fibre device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextFibre (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -599,7 +721,19 @@ DevPathToTextFibre (
   CatPrint (Str, L"Fibre(0x%lx,0x%lx)", Fibre->WWN, Fibre->Lun);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a 1394 device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToText1394 (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -608,16 +742,28 @@ DevPathToText1394 (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  F1394_DEVICE_PATH *F1394;\r
+  F1394_DEVICE_PATH *F1394DevPath;\r
 \r
-  F1394 = DevPath;\r
+  F1394DevPath = DevPath;\r
   //\r
   // Guid has format of IEEE-EUI64\r
   //\r
-  CatPrint (Str, L"I1394(%016lx)", F1394->Guid);\r
+  CatPrint (Str, L"I1394(%016lx)", F1394DevPath->Guid);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a USB device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextUsb (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -632,7 +778,19 @@ DevPathToTextUsb (
   CatPrint (Str, L"USB(0x%x,0x%x)", Usb->ParentPortNumber, Usb->InterfaceNumber);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a USB WWID device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextUsbWWID (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -669,7 +827,19 @@ DevPathToTextUsbWWID (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Logic Unit device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextLogicalUnit (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -684,7 +854,19 @@ DevPathToTextLogicalUnit (
   CatPrint (Str, L"Unit(0x%x)", LogicalUnit->Lun);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a USB class device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextUsbClass (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -808,7 +990,19 @@ DevPathToTextUsbClass (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a SATA device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextSata (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -829,7 +1023,19 @@ DevPathToTextSata (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a I20 device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextI2O (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -838,13 +1044,25 @@ DevPathToTextI2O (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  I2O_DEVICE_PATH *I2O;\r
+  I2O_DEVICE_PATH *I2ODevPath;\r
 \r
-  I2O = DevPath;\r
-  CatPrint (Str, L"I2O(0x%x)", I2O->Tid);\r
+  I2ODevPath = DevPath;\r
+  CatPrint (Str, L"I2O(0x%x)", I2ODevPath->Tid);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a MAC address device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextMacAddr (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -853,27 +1071,39 @@ DevPathToTextMacAddr (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  MAC_ADDR_DEVICE_PATH  *MAC;\r
+  MAC_ADDR_DEVICE_PATH  *MacDevPath;\r
   UINTN                 HwAddressSize;\r
   UINTN                 Index;\r
 \r
-  MAC           = DevPath;\r
+  MacDevPath = DevPath;\r
 \r
   HwAddressSize = sizeof (EFI_MAC_ADDRESS);\r
-  if (MAC->IfType == 0x01 || MAC->IfType == 0x00) {\r
+  if (MacDevPath->IfType == 0x01 || MacDevPath->IfType == 0x00) {\r
     HwAddressSize = 6;\r
   }\r
 \r
   CatPrint (Str, L"MAC(");\r
 \r
   for (Index = 0; Index < HwAddressSize; Index++) {\r
-    CatPrint (Str, L"%02x", MAC->MacAddress.Addr[Index]);\r
+    CatPrint (Str, L"%02x", MacDevPath->MacAddress.Addr[Index]);\r
   }\r
 \r
-  CatPrint (Str, L",0x%x)", MAC->IfType);\r
+  CatPrint (Str, L",0x%x)", MacDevPath->IfType);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a IPv4 device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextIPv4 (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -882,17 +1112,17 @@ DevPathToTextIPv4 (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  IPv4_DEVICE_PATH  *IP;\r
+  IPv4_DEVICE_PATH  *IPDevPath;\r
 \r
-  IP = DevPath;\r
-  if (DisplayOnly == TRUE) {\r
+  IPDevPath = DevPath;\r
+  if (DisplayOnly) {\r
     CatPrint (\r
       Str,\r
       L"IPv4(%d.%d.%d.%d)",\r
-      IP->RemoteIpAddress.Addr[0],\r
-      IP->RemoteIpAddress.Addr[1],\r
-      IP->RemoteIpAddress.Addr[2],\r
-      IP->RemoteIpAddress.Addr[3]\r
+      IPDevPath->RemoteIpAddress.Addr[0],\r
+      IPDevPath->RemoteIpAddress.Addr[1],\r
+      IPDevPath->RemoteIpAddress.Addr[2],\r
+      IPDevPath->RemoteIpAddress.Addr[3]\r
       );\r
     return ;\r
   }\r
@@ -900,20 +1130,32 @@ DevPathToTextIPv4 (
   CatPrint (\r
     Str,\r
     L"IPv4(%d.%d.%d.%d,%s,%s,%d.%d.%d.%d)",\r
-    IP->RemoteIpAddress.Addr[0],\r
-    IP->RemoteIpAddress.Addr[1],\r
-    IP->RemoteIpAddress.Addr[2],\r
-    IP->RemoteIpAddress.Addr[3],\r
-    IP->Protocol ? L"TCP" : L"UDP",\r
-    (IP->StaticIpAddress == TRUE) ? L"Static" : L"DHCP",\r
-    IP->LocalIpAddress.Addr[0],\r
-    IP->LocalIpAddress.Addr[1],\r
-    IP->LocalIpAddress.Addr[2],\r
-    IP->LocalIpAddress.Addr[3]\r
+    IPDevPath->RemoteIpAddress.Addr[0],\r
+    IPDevPath->RemoteIpAddress.Addr[1],\r
+    IPDevPath->RemoteIpAddress.Addr[2],\r
+    IPDevPath->RemoteIpAddress.Addr[3],\r
+    IPDevPath->Protocol ? L"TCP" : L"UDP",\r
+    (IPDevPath->StaticIpAddress == TRUE) ? L"Static" : L"DHCP",\r
+    IPDevPath->LocalIpAddress.Addr[0],\r
+    IPDevPath->LocalIpAddress.Addr[1],\r
+    IPDevPath->LocalIpAddress.Addr[2],\r
+    IPDevPath->LocalIpAddress.Addr[3]\r
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a IPv6 device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextIPv6 (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -922,29 +1164,29 @@ DevPathToTextIPv6 (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  IPv6_DEVICE_PATH  *IP;\r
+  IPv6_DEVICE_PATH  *IPDevPath;\r
 \r
-  IP = DevPath;\r
-  if (DisplayOnly == TRUE) {\r
+  IPDevPath = DevPath;\r
+  if (DisplayOnly) {\r
     CatPrint (\r
       Str,\r
       L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
-      IP->RemoteIpAddress.Addr[0],\r
-      IP->RemoteIpAddress.Addr[1],\r
-      IP->RemoteIpAddress.Addr[2],\r
-      IP->RemoteIpAddress.Addr[3],\r
-      IP->RemoteIpAddress.Addr[4],\r
-      IP->RemoteIpAddress.Addr[5],\r
-      IP->RemoteIpAddress.Addr[6],\r
-      IP->RemoteIpAddress.Addr[7],\r
-      IP->RemoteIpAddress.Addr[8],\r
-      IP->RemoteIpAddress.Addr[9],\r
-      IP->RemoteIpAddress.Addr[10],\r
-      IP->RemoteIpAddress.Addr[11],\r
-      IP->RemoteIpAddress.Addr[12],\r
-      IP->RemoteIpAddress.Addr[13],\r
-      IP->RemoteIpAddress.Addr[14],\r
-      IP->RemoteIpAddress.Addr[15]\r
+      IPDevPath->RemoteIpAddress.Addr[0],\r
+      IPDevPath->RemoteIpAddress.Addr[1],\r
+      IPDevPath->RemoteIpAddress.Addr[2],\r
+      IPDevPath->RemoteIpAddress.Addr[3],\r
+      IPDevPath->RemoteIpAddress.Addr[4],\r
+      IPDevPath->RemoteIpAddress.Addr[5],\r
+      IPDevPath->RemoteIpAddress.Addr[6],\r
+      IPDevPath->RemoteIpAddress.Addr[7],\r
+      IPDevPath->RemoteIpAddress.Addr[8],\r
+      IPDevPath->RemoteIpAddress.Addr[9],\r
+      IPDevPath->RemoteIpAddress.Addr[10],\r
+      IPDevPath->RemoteIpAddress.Addr[11],\r
+      IPDevPath->RemoteIpAddress.Addr[12],\r
+      IPDevPath->RemoteIpAddress.Addr[13],\r
+      IPDevPath->RemoteIpAddress.Addr[14],\r
+      IPDevPath->RemoteIpAddress.Addr[15]\r
       );\r
     return ;\r
   }\r
@@ -952,44 +1194,56 @@ DevPathToTextIPv6 (
   CatPrint (\r
     Str,\r
     L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x,%s,%s,%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
-    IP->RemoteIpAddress.Addr[0],\r
-    IP->RemoteIpAddress.Addr[1],\r
-    IP->RemoteIpAddress.Addr[2],\r
-    IP->RemoteIpAddress.Addr[3],\r
-    IP->RemoteIpAddress.Addr[4],\r
-    IP->RemoteIpAddress.Addr[5],\r
-    IP->RemoteIpAddress.Addr[6],\r
-    IP->RemoteIpAddress.Addr[7],\r
-    IP->RemoteIpAddress.Addr[8],\r
-    IP->RemoteIpAddress.Addr[9],\r
-    IP->RemoteIpAddress.Addr[10],\r
-    IP->RemoteIpAddress.Addr[11],\r
-    IP->RemoteIpAddress.Addr[12],\r
-    IP->RemoteIpAddress.Addr[13],\r
-    IP->RemoteIpAddress.Addr[14],\r
-    IP->RemoteIpAddress.Addr[15],\r
-    IP->Protocol ? L"TCP" : L"UDP",\r
-    (IP->StaticIpAddress == TRUE) ? L"Static" : L"DHCP",\r
-    IP->LocalIpAddress.Addr[0],\r
-    IP->LocalIpAddress.Addr[1],\r
-    IP->LocalIpAddress.Addr[2],\r
-    IP->LocalIpAddress.Addr[3],\r
-    IP->LocalIpAddress.Addr[4],\r
-    IP->LocalIpAddress.Addr[5],\r
-    IP->LocalIpAddress.Addr[6],\r
-    IP->LocalIpAddress.Addr[7],\r
-    IP->LocalIpAddress.Addr[8],\r
-    IP->LocalIpAddress.Addr[9],\r
-    IP->LocalIpAddress.Addr[10],\r
-    IP->LocalIpAddress.Addr[11],\r
-    IP->LocalIpAddress.Addr[12],\r
-    IP->LocalIpAddress.Addr[13],\r
-    IP->LocalIpAddress.Addr[14],\r
-    IP->LocalIpAddress.Addr[15]\r
+    IPDevPath->RemoteIpAddress.Addr[0],\r
+    IPDevPath->RemoteIpAddress.Addr[1],\r
+    IPDevPath->RemoteIpAddress.Addr[2],\r
+    IPDevPath->RemoteIpAddress.Addr[3],\r
+    IPDevPath->RemoteIpAddress.Addr[4],\r
+    IPDevPath->RemoteIpAddress.Addr[5],\r
+    IPDevPath->RemoteIpAddress.Addr[6],\r
+    IPDevPath->RemoteIpAddress.Addr[7],\r
+    IPDevPath->RemoteIpAddress.Addr[8],\r
+    IPDevPath->RemoteIpAddress.Addr[9],\r
+    IPDevPath->RemoteIpAddress.Addr[10],\r
+    IPDevPath->RemoteIpAddress.Addr[11],\r
+    IPDevPath->RemoteIpAddress.Addr[12],\r
+    IPDevPath->RemoteIpAddress.Addr[13],\r
+    IPDevPath->RemoteIpAddress.Addr[14],\r
+    IPDevPath->RemoteIpAddress.Addr[15],\r
+    IPDevPath->Protocol ? L"TCP" : L"UDP",\r
+    (IPDevPath->StaticIpAddress == TRUE) ? L"Static" : L"DHCP",\r
+    IPDevPath->LocalIpAddress.Addr[0],\r
+    IPDevPath->LocalIpAddress.Addr[1],\r
+    IPDevPath->LocalIpAddress.Addr[2],\r
+    IPDevPath->LocalIpAddress.Addr[3],\r
+    IPDevPath->LocalIpAddress.Addr[4],\r
+    IPDevPath->LocalIpAddress.Addr[5],\r
+    IPDevPath->LocalIpAddress.Addr[6],\r
+    IPDevPath->LocalIpAddress.Addr[7],\r
+    IPDevPath->LocalIpAddress.Addr[8],\r
+    IPDevPath->LocalIpAddress.Addr[9],\r
+    IPDevPath->LocalIpAddress.Addr[10],\r
+    IPDevPath->LocalIpAddress.Addr[11],\r
+    IPDevPath->LocalIpAddress.Addr[12],\r
+    IPDevPath->LocalIpAddress.Addr[13],\r
+    IPDevPath->LocalIpAddress.Addr[14],\r
+    IPDevPath->LocalIpAddress.Addr[15]\r
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts an Infini Band device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextInfiniBand (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1012,7 +1266,19 @@ DevPathToTextInfiniBand (
     );\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a UART device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextUart (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1092,7 +1358,19 @@ DevPathToTextUart (
   }\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts an iSCSI device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextiSCSI (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1101,34 +1379,46 @@ DevPathToTextiSCSI (
   IN BOOLEAN         AllowShortcuts\r
   )\r
 {\r
-  ISCSI_DEVICE_PATH_WITH_NAME *iSCSI;\r
+  ISCSI_DEVICE_PATH_WITH_NAME *ISCSIDevPath;\r
   UINT16                      Options;\r
 \r
-  iSCSI = DevPath;\r
+  ISCSIDevPath = DevPath;\r
   CatPrint (\r
     Str,\r
     L"iSCSI(%a,0x%x,0x%lx,",\r
-    iSCSI->iSCSITargetName,\r
-    iSCSI->TargetPortalGroupTag,\r
-    iSCSI->Lun\r
+    ISCSIDevPath->iSCSITargetName,\r
+    ISCSIDevPath->TargetPortalGroupTag,\r
+    ISCSIDevPath->Lun\r
     );\r
 \r
-  Options = iSCSI->LoginOption;\r
-  CatPrint (Str, L"%s,", ((Options >> 1) & 0x0001) ? L"CRC32C" : L"None");\r
-  CatPrint (Str, L"%s,", ((Options >> 3) & 0x0001) ? L"CRC32C" : L"None");\r
-  if ((Options >> 11) & 0x0001) {\r
+  Options = ISCSIDevPath->LoginOption;\r
+  CatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
+  CatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
+  if (((Options >> 11) & 0x0001) != 0) {\r
     CatPrint (Str, L"%s,", L"None");\r
-  } else if ((Options >> 12) & 0x0001) {\r
+  } else if (((Options >> 12) & 0x0001) != 0) {\r
     CatPrint (Str, L"%s,", L"CHAP_UNI");\r
   } else {\r
     CatPrint (Str, L"%s,", L"CHAP_BI");\r
 \r
   }\r
 \r
-  CatPrint (Str, L"%s)", (iSCSI->NetworkProtocol == 0) ? L"TCP" : L"reserved");\r
+  CatPrint (Str, L"%s)", (ISCSIDevPath->NetworkProtocol == 0) ? L"TCP" : L"reserved");\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Hard drive device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextHardDrive (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1174,7 +1464,19 @@ DevPathToTextHardDrive (
   CatPrint (Str, L"0x%lx,0x%lx)", Hd->PartitionStart, Hd->PartitionSize);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a CDROM device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextCDROM (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1186,7 +1488,7 @@ DevPathToTextCDROM (
   CDROM_DEVICE_PATH *Cd;\r
 \r
   Cd = DevPath;\r
-  if (DisplayOnly == TRUE) {\r
+  if (DisplayOnly) {\r
     CatPrint (Str, L"CDROM(0x%x)", Cd->BootEntry);\r
     return ;\r
   }\r
@@ -1194,7 +1496,19 @@ DevPathToTextCDROM (
   CatPrint (Str, L"CDROM(0x%x,0x%lx,0x%lx)", Cd->BootEntry, Cd->PartitionStart, Cd->PartitionSize);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a File device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextFilePath (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1209,7 +1523,19 @@ DevPathToTextFilePath (
   CatPrint (Str, L"%s", Fp->PathName);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Media protocol device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextMediaProtocol (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1224,7 +1550,19 @@ DevPathToTextMediaProtocol (
   CatPrint (Str, L"Media(%g)", &MediaProt->Protocol);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Firmware Volume device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextFv (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1239,7 +1577,19 @@ DevPathToTextFv (
   CatPrint (Str, L"Fv(%g)", &Fv->FvName);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a Firmware Volume File device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextFvFile (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1254,7 +1604,19 @@ DevPathToTextFvFile (
   CatPrint (Str, L"FvFile(%g)", &FvFile->FvFileName);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts a BIOS Boot Specification device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextBBS (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1303,7 +1665,7 @@ DevPathToTextBBS (
     CatPrint (Str, L"BBS(0x%x,%a", Bbs->DeviceType, Bbs->String);\r
   }\r
 \r
-  if (DisplayOnly == TRUE) {\r
+  if (DisplayOnly) {\r
     CatPrint (Str, L")");\r
     return ;\r
   }\r
@@ -1311,7 +1673,19 @@ DevPathToTextBBS (
   CatPrint (Str, L",0x%x)", Bbs->StatusFlag);\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts an End-of-Device-Path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextEndInstance (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1323,7 +1697,19 @@ DevPathToTextEndInstance (
   CatPrint (Str, L",");\r
 }\r
 \r
-STATIC\r
+/**\r
+  Converts an unknown device path structure to its string representive.\r
+\r
+  @param Str             The string representive of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
 VOID\r
 DevPathToTextNodeUnknown (\r
   IN OUT POOL_PRINT  *Str,\r
@@ -1374,31 +1760,28 @@ GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_TABLE DevPathToTextTable
   {0, 0, NULL}\r
 };\r
 \r
+/**\r
+  Converts a device node to its string representation.\r
+\r
+  @param DeviceNode        A Pointer to the device node to be converted.\r
+  @param DisplayOnly       If DisplayOnly is TRUE, then the shorter text representation\r
+                           of the display node is used, where applicable. If DisplayOnly\r
+                           is FALSE, then the longer text representation of the display node\r
+                           is used.\r
+  @param AllowShortcuts    If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                           representation for a device node can be used, where applicable.\r
+\r
+  @return A pointer to the allocated text representation of the device node or NULL if DeviceNode\r
+          is NULL or there was insufficient memory.\r
+\r
+**/\r
 CHAR16 *\r
+EFIAPI\r
 ConvertDeviceNodeToText (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DeviceNode,\r
   IN BOOLEAN                         DisplayOnly,\r
   IN BOOLEAN                         AllowShortcuts\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Convert a device node to its text representation.\r
-\r
-  Arguments:\r
-    DeviceNode       -   Points to the device node to be converted.\r
-    DisplayOnly      -   If DisplayOnly is TRUE, then the shorter text representation\r
-                         of the display node is used, where applicable. If DisplayOnly\r
-                         is FALSE, then the longer text representation of the display node\r
-                         is used.\r
-    AllowShortcuts   -   If AllowShortcuts is TRUE, then the shortcut forms of text\r
-                         representation for a device node can be used, where applicable.\r
-\r
-  Returns:\r
-    A pointer        -   a pointer to the allocated text representation of the device node.\r
-    NULL             -   if DeviceNode is NULL or there was insufficient memory.\r
-\r
---*/\r
 {\r
   POOL_PRINT  Str;\r
   UINTN       Index;\r
@@ -1445,31 +1828,28 @@ ConvertDeviceNodeToText (
   return Str.Str;\r
 }\r
 \r
-CHAR16 *\r
-ConvertDevicePathToText (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,\r
-  IN BOOLEAN                          DisplayOnly,\r
-  IN BOOLEAN                          AllowShortcuts\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Convert a device path to its text representation.\r
+/**\r
+  Converts a device path to its text representation.\r
 \r
-  Arguments:\r
-    DeviceNode       -   Points to the device path to be converted.\r
-    DisplayOnly      -   If DisplayOnly is TRUE, then the shorter text representation\r
+  @param DevicePath      A Pointer to the device to be converted.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
                          is FALSE, then the longer text representation of the display node\r
                          is used.\r
-    AllowShortcuts   -   If AllowShortcuts is TRUE, then the shortcut forms of text\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
                          representation for a device node can be used, where applicable.\r
 \r
-  Returns:\r
-    A pointer        -   a pointer to the allocated text representation of the device path.\r
-    NULL             -   if DeviceNode is NULL or there was insufficient memory.\r
+  @return A pointer to the allocated text representation of the device path or\r
+          NULL if DeviceNode is NULL or there was insufficient memory.\r
 \r
---*/\r
+**/\r
+CHAR16 *\r
+EFIAPI\r
+ConvertDevicePathToText (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,\r
+  IN BOOLEAN                          DisplayOnly,\r
+  IN BOOLEAN                          AllowShortcuts\r
+  )\r
 {\r
   POOL_PRINT                Str;\r
   EFI_DEVICE_PATH_PROTOCOL  *DevPathNode;\r
@@ -1517,7 +1897,7 @@ ConvertDevicePathToText (
     //\r
     //  Put a path seperator in if needed\r
     //\r
-    if (Str.Len && DumpNode != DevPathToTextEndInstance) {\r
+    if ((Str.Len != 0) && DumpNode != DevPathToTextEndInstance) {\r
       if (*(Str.Str + Str.Len / sizeof (CHAR16) - 1) != L',') {\r
         CatPrint (&Str, L"/");\r
       }\r