]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c
Remove the work-around in DevicePathLib to judge the end of device path node type.
[mirror_edk2.git] / MdePkg / Library / UefiDevicePathLibDevicePathProtocol / UefiDevicePathLib.c
index 393c7f45280674213b080fab55c50fe0004ad601..25fcc8293c12712dc2b7def8ec566f6bcfce67c0 100644 (file)
@@ -182,7 +182,7 @@ IsDevicePathEndType (
   )\r
 {\r
   ASSERT (Node != NULL);\r
-  return ((DevicePathType (Node) & 0x7f) == END_DEVICE_PATH_TYPE);\r
+  return (BOOLEAN) (DevicePathType (Node)) == END_DEVICE_PATH_TYPE);\r
 }\r
 \r
 /**\r
@@ -205,7 +205,7 @@ IsDevicePathEnd (
   )\r
 {\r
   ASSERT (Node != NULL);\r
-  return (IsDevicePathEndType (Node) && DevicePathSubType(Node) == END_ENTIRE_DEVICE_PATH_SUBTYPE);\r
+  return (BOOLEAN) (IsDevicePathEndType (Node) && DevicePathSubType(Node) == END_ENTIRE_DEVICE_PATH_SUBTYPE);\r
 }\r
 \r
 /**\r
@@ -228,7 +228,7 @@ IsDevicePathEndInstance (
   )\r
 {\r
   ASSERT (Node != NULL);\r
-  return (IsDevicePathEndType (Node) && DevicePathSubType(Node) == END_INSTANCE_DEVICE_PATH_SUBTYPE);\r
+  return (BOOLEAN) (IsDevicePathEndType (Node) && DevicePathSubType(Node) == END_INSTANCE_DEVICE_PATH_SUBTYPE);\r
 }\r
 \r
 /**\r
@@ -250,13 +250,13 @@ IsDevicePathEndInstance (
 **/\r
 UINT16\r
 SetDevicePathNodeLength (\r
-IN VOID   *Node,\r
-IN UINTN  NodeLength\r
+  IN OUT VOID  *Node,\r
+  IN UINTN     Length\r
   )\r
 {\r
   ASSERT (Node != NULL);\r
-  ASSERT (NodeLength < 0x10000);\r
-  return WriteUnaligned16 ((UINT16 *)&((EFI_DEVICE_PATH_PROTOCOL *)(Node))->Length[0], (UINT16)(NodeLength));\r
+  ASSERT (Length < 0x10000);\r
+  return WriteUnaligned16 ((UINT16 *)&((EFI_DEVICE_PATH_PROTOCOL *)(Node))->Length[0], (UINT16)(Length));\r
 }\r
 \r
 /**\r
@@ -277,7 +277,7 @@ IN UINTN  NodeLength
 **/\r
 VOID\r
 SetDevicePathEndNode (\r
-  IN VOID  *Node\r
+  OUT VOID  *Node\r
   )\r
 {\r
   ASSERT (Node != NULL);\r