]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg Shell: Remove redundant functions
authorshenglei <shenglei.zhang@intel.com>
Thu, 9 Aug 2018 03:27:45 +0000 (11:27 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 6 Sep 2018 09:47:52 +0000 (17:47 +0800)
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>
ShellPkg/Application/Shell/Shell.c
ShellPkg/Application/Shell/Shell.h
ShellPkg/Application/Shell/ShellParametersProtocol.c
ShellPkg/Application/Shell/ShellProtocol.c

index 47ae3c373c2ccd5b451663fe1dce4069e3215e37..397cfd19949050bc6d2a3662f1fe2d8bdf9221ab 100644 (file)
@@ -2752,35 +2752,6 @@ RunCommand(
 \r
 \r
 STATIC CONST UINT16 InvalidChars[] = {L'*', L'?', L'<', L'>', L'\\', L'/', L'\"', 0x0001, 0x0002};\r
-/**\r
-  Function determines if the CommandName COULD be a valid command.  It does not determine whether\r
-  this is a valid command.  It only checks for invalid characters.\r
-\r
-  @param[in] CommandName    The name to check\r
-\r
-  @retval TRUE              CommandName could be a command name\r
-  @retval FALSE             CommandName could not be a valid command name\r
-**/\r
-BOOLEAN\r
-IsValidCommandName(\r
-  IN CONST CHAR16     *CommandName\r
-  )\r
-{\r
-  UINTN Count;\r
-  if (CommandName == NULL) {\r
-    ASSERT(FALSE);\r
-    return (FALSE);\r
-  }\r
-  for ( Count = 0\r
-      ; Count < sizeof(InvalidChars) / sizeof(InvalidChars[0])\r
-      ; Count++\r
-     ){\r
-    if (ScanMem16(CommandName, StrSize(CommandName), InvalidChars[Count]) != NULL) {\r
-      return (FALSE);\r
-    }\r
-  }\r
-  return (TRUE);\r
-}\r
 \r
 /**\r
   Function to process a NSH script file via SHELL_FILE_HANDLE.\r
index 69b19c6a2d3bbb51d7e8800084e7e85fe2adcdff..bad8f08d473a691070aee6347c0de0a2f125f25f 100644 (file)
@@ -309,19 +309,6 @@ RunShellCommand(
   OUT EFI_STATUS    *CommandStatus\r
   );\r
 \r
-/**\r
-  Function determines if the CommandName COULD be a valid command.  It does not determine whether\r
-  this is a valid command.  It only checks for invalid characters.\r
-\r
-  @param[in] CommandName    The name to check\r
-\r
-  @retval TRUE              CommandName could be a command name\r
-  @retval FALSE             CommandName could not be a valid command name\r
-**/\r
-BOOLEAN\r
-IsValidCommandName(\r
-  IN CONST CHAR16     *CommandName\r
-  );\r
 \r
 /**\r
   Function to process a NSH script file via SHELL_FILE_HANDLE.\r
index 90889a372524bfbe3e1e7aefcbd12b3e4e5d8148..a21c6905180e9b3744b86ad8355ea5495bb2a31b 100644 (file)
@@ -626,30 +626,6 @@ FixVarName (
   return (FixFileName(Copy));\r
 }\r
 \r
-/**\r
-  Remove the unicode file tag from the begining of the file buffer since that will not be\r
-  used by StdIn.\r
-\r
-  @param[in]  Handle    Pointer to the handle of the file to be processed.\r
-\r
-  @retval EFI_SUCCESS   The unicode file tag has been moved successfully.\r
-**/\r
-EFI_STATUS\r
-RemoveFileTag(\r
-  IN SHELL_FILE_HANDLE *Handle\r
-  )\r
-{\r
-  UINTN             CharSize;\r
-  CHAR16            CharBuffer;\r
-\r
-  CharSize    = sizeof(CHAR16);\r
-  CharBuffer  = 0;\r
-  gEfiShellProtocol->ReadFile(*Handle, &CharSize, &CharBuffer);\r
-  if (CharBuffer != gUnicodeFileTag) {\r
-    gEfiShellProtocol->SetFilePosition(*Handle, 0);\r
-  }\r
-  return (EFI_SUCCESS);\r
-}\r
 \r
 /**\r
   Write the unicode file tag to the specified file.\r
index 9e9e6dc052bdb0b4dbed4e85773ee4b9e519af94..46a4974a7f32c83b497442a3c3bf45027e449141 100644 (file)
@@ -98,40 +98,6 @@ InternalShellProtocolIsSimpleFileSystemPresent(
   return (FALSE);\r
 }\r
 \r
-/**\r
-  Internal worker debug helper function to print out maps as they are added.\r
-\r
-  @param[in] Mapping        string mapping that has been added\r
-  @param[in] DevicePath     pointer to device path that has been mapped.\r
-\r
-  @retval EFI_SUCCESS   the operation was successful.\r
-  @return other         an error ocurred\r
-\r
-  @sa LocateHandle\r
-  @sa OpenProtocol\r
-**/\r
-EFI_STATUS\r
-InternalShellProtocolDebugPrintMessage (\r
-  IN CONST CHAR16                   *Mapping,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
-  )\r
-{\r
-  EFI_STATUS                        Status;\r
-  CHAR16                            *Temp;\r
-\r
-  Status = EFI_SUCCESS;\r
-  DEBUG_CODE_BEGIN();\r
-\r
-  if (Mapping != NULL) {\r
-    DEBUG((EFI_D_INFO, "Added new map item:\"%S\"\r\n", Mapping));\r
-  }\r
-  Temp = ConvertDevicePathToText(DevicePath, TRUE, TRUE);\r
-  DEBUG((EFI_D_INFO, "DevicePath: %S\r\n", Temp));\r
-  FreePool(Temp);\r
-\r
-  DEBUG_CODE_END();\r
-  return (Status);\r
-}\r
 \r
 /**\r
   This function creates a mapping for a device path.\r
@@ -1333,7 +1299,7 @@ EfiShellOpenFileByName(
   // We are opening a regular file.\r
   //\r
   DevicePath = EfiShellGetDevicePathFromFilePath(FileName);\r
-//  DEBUG_CODE(InternalShellProtocolDebugPrintMessage (NULL, DevicePath););\r
+\r
   if (DevicePath == NULL) {\r
     return (EFI_NOT_FOUND);\r
   }\r
@@ -2261,52 +2227,7 @@ EfiShellGetGuidName(
   return (EFI_SUCCESS);\r
 }\r
 \r
-/**\r
-  Updates a file name to be preceeded by the mapped drive name\r
-\r
-  @param[in] BasePath      the Mapped drive name to prepend\r
-  @param[in, out] Path     pointer to pointer to the file name to update.\r
-\r
-  @retval EFI_SUCCESS\r
-  @retval EFI_OUT_OF_RESOURCES\r
-**/\r
-EFI_STATUS\r
-UpdateFileName(\r
-  IN CONST CHAR16 *BasePath,\r
-  IN OUT CHAR16   **Path\r
-  )\r
-{\r
-  CHAR16              *Path2;\r
-  UINTN               Path2Size;\r
-\r
-  Path2Size = 0;\r
-  Path2 = NULL;\r
-\r
-  ASSERT(Path      != NULL);\r
-  ASSERT(*Path     != NULL);\r
-  ASSERT(BasePath  != NULL);\r
-\r
-  //\r
-  // convert a local path to an absolute path\r
-  //\r
-  if (StrStr(*Path, L":") == NULL) {\r
-    ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));\r
-    StrnCatGrow(&Path2, &Path2Size, BasePath, 0);\r
-    if (Path2 == NULL) {\r
-      return (EFI_OUT_OF_RESOURCES);\r
-    }\r
-    ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));\r
-    StrnCatGrow(&Path2, &Path2Size, (*Path)[0] == L'\\'?(*Path) + 1 :*Path, 0);\r
-    if (Path2 == NULL) {\r
-      return (EFI_OUT_OF_RESOURCES);\r
-    }\r
-  }\r
-\r
-  FreePool(*Path);\r
-  (*Path) = Path2;\r
 \r
-  return (EFI_SUCCESS);\r
-}\r
 \r
 /**\r
   If FileHandle is a directory then the function reads from FileHandle and reads in\r