ShellPkg Shell: Remove redundant functions
The redundant functions which are never called have been removed. They are InternalShellProtocolDebugPrintMessage, UpdateFileName,RemoveFileTag and IsValidCommandName. https://bugzilla.tianocore.org/show_bug.cgi?id=1066 Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shenglei <shenglei.zhang@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
@ -98,40 +98,6 @@ InternalShellProtocolIsSimpleFileSystemPresent(
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
Internal worker debug helper function to print out maps as they are added.
|
||||
|
||||
@param[in] Mapping string mapping that has been added
|
||||
@param[in] DevicePath pointer to device path that has been mapped.
|
||||
|
||||
@retval EFI_SUCCESS the operation was successful.
|
||||
@return other an error ocurred
|
||||
|
||||
@sa LocateHandle
|
||||
@sa OpenProtocol
|
||||
**/
|
||||
EFI_STATUS
|
||||
InternalShellProtocolDebugPrintMessage (
|
||||
IN CONST CHAR16 *Mapping,
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
CHAR16 *Temp;
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
DEBUG_CODE_BEGIN();
|
||||
|
||||
if (Mapping != NULL) {
|
||||
DEBUG((EFI_D_INFO, "Added new map item:\"%S\"\r\n", Mapping));
|
||||
}
|
||||
Temp = ConvertDevicePathToText(DevicePath, TRUE, TRUE);
|
||||
DEBUG((EFI_D_INFO, "DevicePath: %S\r\n", Temp));
|
||||
FreePool(Temp);
|
||||
|
||||
DEBUG_CODE_END();
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/**
|
||||
This function creates a mapping for a device path.
|
||||
@ -1333,7 +1299,7 @@ EfiShellOpenFileByName(
|
||||
// We are opening a regular file.
|
||||
//
|
||||
DevicePath = EfiShellGetDevicePathFromFilePath(FileName);
|
||||
// DEBUG_CODE(InternalShellProtocolDebugPrintMessage (NULL, DevicePath););
|
||||
|
||||
if (DevicePath == NULL) {
|
||||
return (EFI_NOT_FOUND);
|
||||
}
|
||||
@ -2261,52 +2227,7 @@ EfiShellGetGuidName(
|
||||
return (EFI_SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
Updates a file name to be preceeded by the mapped drive name
|
||||
|
||||
@param[in] BasePath the Mapped drive name to prepend
|
||||
@param[in, out] Path pointer to pointer to the file name to update.
|
||||
|
||||
@retval EFI_SUCCESS
|
||||
@retval EFI_OUT_OF_RESOURCES
|
||||
**/
|
||||
EFI_STATUS
|
||||
UpdateFileName(
|
||||
IN CONST CHAR16 *BasePath,
|
||||
IN OUT CHAR16 **Path
|
||||
)
|
||||
{
|
||||
CHAR16 *Path2;
|
||||
UINTN Path2Size;
|
||||
|
||||
Path2Size = 0;
|
||||
Path2 = NULL;
|
||||
|
||||
ASSERT(Path != NULL);
|
||||
ASSERT(*Path != NULL);
|
||||
ASSERT(BasePath != NULL);
|
||||
|
||||
//
|
||||
// convert a local path to an absolute path
|
||||
//
|
||||
if (StrStr(*Path, L":") == NULL) {
|
||||
ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));
|
||||
StrnCatGrow(&Path2, &Path2Size, BasePath, 0);
|
||||
if (Path2 == NULL) {
|
||||
return (EFI_OUT_OF_RESOURCES);
|
||||
}
|
||||
ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));
|
||||
StrnCatGrow(&Path2, &Path2Size, (*Path)[0] == L'\\'?(*Path) + 1 :*Path, 0);
|
||||
if (Path2 == NULL) {
|
||||
return (EFI_OUT_OF_RESOURCES);
|
||||
}
|
||||
}
|
||||
|
||||
FreePool(*Path);
|
||||
(*Path) = Path2;
|
||||
|
||||
return (EFI_SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
If FileHandle is a directory then the function reads from FileHandle and reads in
|
||||
|
Reference in New Issue
Block a user