Code scrub for GenericBdsLib library instance.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6786 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2
2008-12-01 05:55:58 +00:00
parent 168da756c6
commit b0dd810861
5 changed files with 15 additions and 50 deletions

View File

@ -1492,45 +1492,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;
}