X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FGenericBdsLib%2FDevicePath.c;h=135fa63d1a018995d57a80f652243aad6115ded7;hb=e56187913724379012649c0411668f94ac2ffd9f;hp=421bba00cb37119e2961d6e50b2aab1fa1693f5b;hpb=d777486198d8ec66e2f461a641d505f4063e1e5e;p=mirror_edk2.git diff --git a/MdeModulePkg/Library/GenericBdsLib/DevicePath.c b/MdeModulePkg/Library/GenericBdsLib/DevicePath.c index 421bba00cb..135fa63d1a 100644 --- a/MdeModulePkg/Library/GenericBdsLib/DevicePath.c +++ b/MdeModulePkg/Library/GenericBdsLib/DevicePath.c @@ -19,15 +19,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Concatenates a formatted unicode string to allocated pool. The caller must free the resulting buffer. - @param Str Tracks the allocated pool, size in use, and amount of pool - allocated. + @param Str Tracks the allocated pool, size in use, and amount of pool allocated. @param fmt The format string - - @param ... Variable argument list. + @param ... The data will be printed. @return Allocated buffer with the formatted string printed in it. - The caller must free the allocated buffer. The buffer - allocation is not packed. + The caller must free the allocated buffer. + The buffer allocation is not packed. **/ CHAR16 * @@ -172,13 +170,10 @@ DevPathController ( /** - Convert Device Path to a Unicode string for printing. + Convert Vendor device path to device name. - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. + @param Str The buffer store device name + @param DevPath Pointer to vendor device path **/ VOID @@ -1480,10 +1475,6 @@ DevicePathToStr ( // DevPathNode = NextDevicePathNode (DevPathNode); } - // - // Shrink pool used for string allocation - // - FreePool (DevPath); Done: NewSize = (Str.len + 1) * sizeof (CHAR16); @@ -1492,45 +1483,3 @@ Done: Str.str[Str.len] = 0; return Str.str; } - -/** - Function creates a device path data structure that identically matches the - device path passed in. - - @param DevPath A pointer to a device path data structure. - - @return The new copy of DevPath is created to identically match the input. - @return Otherwise, NULL is returned. - -**/ -EFI_DEVICE_PATH_PROTOCOL * -LibDuplicateDevicePathInstance ( - IN EFI_DEVICE_PATH_PROTOCOL *DevPath - ) -{ - EFI_DEVICE_PATH_PROTOCOL *NewDevPath; - EFI_DEVICE_PATH_PROTOCOL *DevicePathInst; - EFI_DEVICE_PATH_PROTOCOL *Temp; - UINTN Size; - - // - // get the size of an instance from the input - // - Temp = DevPath; - DevicePathInst = GetNextDevicePathInstance (&Temp, &Size); - - // - // Make a copy - // - NewDevPath = NULL; - if (Size != 0) { - NewDevPath = AllocateZeroPool (Size); - ASSERT (NewDevPath != NULL); - } - - if (NewDevPath != NULL) { - CopyMem (NewDevPath, DevicePathInst, Size); - } - - return NewDevPath; -}