]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove local function IsValidDevicePath and use new interface provided by UefiDeviceP...
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 26 Sep 2012 09:01:23 +0000 (09:01 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 26 Sep 2012 09:01:23 +0000 (09:01 +0000)
Signed-off-by: Ruiyu Ni<ruiyu.ni@intel.com>
Reviewed-by: Eric Dong<eric.dong@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13742 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c

index def572d2d5a00cb9b5177290601dedef56222755..7949d0995f81e543ac7dfd536b7cda58ded2841b 100644 (file)
@@ -274,56 +274,6 @@ BdsBootDeviceSelect (
 \r
 }\r
 \r
-/**\r
-  Validate the device path instance. \r
-\r
-  Only base on the length filed in the device path node to validate the device path. \r
-\r
-  @param  DevicePath         A pointer to a device path data structure.\r
-  @param  MaxSize            Max valid device path size. If big than this size, \r
-                             return error.\r
-  \r
-  @retval TRUE               An valid device path.\r
-  @retval FALSE              An invalid device path.\r
-\r
-**/\r
-BOOLEAN\r
-IsValidDevicePath (\r
-  IN EFI_DEVICE_PATH_PROTOCOL  *DevicePath,\r
-  IN UINTN                     MaxSize\r
-  )\r
-{\r
-  UINTN  Size;\r
-  UINTN  NodeSize;\r
-\r
-  if (DevicePath == NULL) {\r
-    return TRUE;\r
-  }\r
-\r
-  Size = 0;\r
-\r
-  while (!IsDevicePathEnd (DevicePath)) {\r
-    NodeSize = DevicePathNodeLength (DevicePath);\r
-    if (NodeSize < END_DEVICE_PATH_LENGTH) {\r
-      return FALSE;\r
-    }\r
-\r
-    Size += NodeSize;\r
-    if (Size > MaxSize) {\r
-      return FALSE;\r
-    }\r
-\r
-    DevicePath = NextDevicePathNode (DevicePath);\r
-  }\r
-\r
-  Size += DevicePathNodeLength (DevicePath);\r
-  if (Size > MaxSize) {\r
-    return FALSE;\r
-  }\r
-\r
-  return TRUE;\r
-}\r
-\r
 /**\r
 \r
   Validate input console variable data. \r
@@ -347,7 +297,7 @@ BdsFormalizeConsoleVariable (
                       &gEfiGlobalVariableGuid,\r
                       &VariableSize\r
                       );\r
-  if (!IsValidDevicePath (DevicePath, VariableSize)) { \r
+  if ((DevicePath != NULL) && !IsDevicePathValid (DevicePath, VariableSize)) { \r
     Status = gRT->SetVariable (\r
                     VariableName,\r
                     &gEfiGlobalVariableGuid,\r