]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
Fix issue from code scrub.
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / BootMaint / ConsoleOption.c
index 0fc187aca39a796281ae7defc930d3837c0fa27d..da0a8389fa43ebbd9596d5d819fc738272f33d70 100644 (file)
@@ -14,21 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "BootMaint.h"\r
 \r
-/**\r
-  Function creates a device path data structure that identically matches the\r
-  device path passed in.\r
-\r
-  @param DevPath         A pointer to a device path data structure.\r
-\r
-  @return        The new copy of DevPath is created to identically match the input.\r
-  @retval  NULL  Otherwise, NULL is returned.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL  *\r
-DevicePathInstanceDup (\r
-  IN EFI_DEVICE_PATH_PROTOCOL  *DevPath\r
-  );\r
-\r
 /**\r
   Update Com Ports attributes from DevicePath\r
 \r
@@ -423,7 +408,7 @@ LocateSerialIo (
 \r
       NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;\r
       CopyMem (&NewMenuEntry->OptionNumber, &Acpi->UID, sizeof (UINT32));\r
-      NewTerminalContext->DevicePath = DevicePathInstanceDup (DevicePath);\r
+      NewTerminalContext->DevicePath = DuplicateDevicePath (DevicePath);\r
       //\r
       // BugBug: I have no choice, calling EfiLibStrFromDatahub will hang the system!\r
       // coz' the misc data for each platform is not correct, actually it's the device path stored in\r
@@ -547,7 +532,6 @@ LocateSerialIo (
 /**\r
   Update Com Ports attributes from DevicePath\r
 \r
-\r
   @param DevicePath      DevicePath that contains Com ports\r
 \r
   @retval EFI_SUCCESS   The update is successful.\r
@@ -665,54 +649,6 @@ UpdateComAttributeFromVariable (
   return EFI_SUCCESS;\r
 }\r
 \r
-/**\r
-  Function creates a device path data structure that identically matches the\r
-  device path passed in.\r
-\r
-\r
-  @param DevPath         A pointer to a device path data structure.\r
-\r
-  @return        The new copy of DevPath is created to identically match the input.\r
-  @retval  NULL  Otherwise, NULL is returned.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-DevicePathInstanceDup (\r
-  IN EFI_DEVICE_PATH_PROTOCOL  *DevPath\r
-  )\r
-{\r
-  EFI_DEVICE_PATH_PROTOCOL  *NewDevPath;\r
-  EFI_DEVICE_PATH_PROTOCOL  *DevicePathInst;\r
-  EFI_DEVICE_PATH_PROTOCOL  *Temp;\r
-  UINT8                     *Ptr;\r
-  UINTN                     Size;\r
-\r
-  //\r
-  // get the size of an instance from the input\r
-  //\r
-  Temp            = DevPath;\r
-  DevicePathInst  = GetNextDevicePathInstance (&Temp, &Size);\r
-\r
-  //\r
-  // Make a copy and set proper end type\r
-  //\r
-  NewDevPath = NULL;\r
-  if (Size != 0) {\r
-    NewDevPath = AllocateZeroPool (Size);\r
-    ASSERT (NewDevPath != NULL);\r
-  }\r
-\r
-  if (NewDevPath != NULL) {\r
-    CopyMem (NewDevPath, DevicePathInst, Size);\r
-    Ptr = (UINT8 *) NewDevPath;\r
-    Ptr += Size - sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
-    Temp = (EFI_DEVICE_PATH_PROTOCOL *) Ptr;\r
-    SetDevicePathEndNode (Temp);\r
-  }\r
-\r
-  return NewDevPath;\r
-}\r
-\r
 /**\r
   Build up Console Menu based on types passed in. The type can\r
   be BM_CONSOLE_IN_CONTEXT_SELECT, BM_CONSOLE_OUT_CONTEXT_SELECT\r
@@ -818,7 +754,7 @@ GetConsoleMenu (
     NewConsoleContext             = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;\r
     NewMenuEntry->OptionNumber    = Index2;\r
 \r
-    NewConsoleContext->DevicePath = DevicePathInstanceDup (DevicePathInst);\r
+    NewConsoleContext->DevicePath = DuplicateDevicePath (DevicePathInst);\r
     NewMenuEntry->DisplayString   = EfiLibStrFromDatahub (NewConsoleContext->DevicePath);\r
     if (NULL == NewMenuEntry->DisplayString) {\r
       NewMenuEntry->DisplayString = DevicePathToStr (NewConsoleContext->DevicePath);\r