]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/BdsDxe/BootMaint/BmLib.c
Clean up BootMaint module in BdsDxe.
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / BootMaint / BmLib.c
index d5c32c8ac193dc3f212ea62fc0b5d4630d0e0f5a..1630eeb1553fb82c4534fd7f93aa3385d61914ea 100644 (file)
@@ -14,43 +14,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "BootMaint.h"\r
 \r
-/**\r
-  Wrap original AllocatePool gBS call\r
-  and ZeroMem gBS call into a single\r
-  function in order to decrease code length\r
-\r
-\r
-  @param Size            The size to allocate\r
-\r
-  @return  Valid pointer to the allocated buffer\r
-  @retval  Null for failure\r
-\r
-**/\r
-VOID *\r
-EfiAllocateZeroPool (\r
-  IN UINTN            Size\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-  VOID        *Ptr;\r
-  Status = gBS->AllocatePool (EfiBootServicesData, Size, &Ptr);\r
-  if (EFI_ERROR (Status)) {\r
-    Ptr = NULL;\r
-    return Ptr;\r
-  }\r
-\r
-  ZeroMem (Ptr, Size);\r
-  return Ptr;\r
-}\r
-\r
 /**\r
 \r
   Find the first instance of this Protocol\r
   in the system and return it's interface\r
 \r
 \r
-  @param ProtocolGuid    Provides the protocol to search for\r
-  @param Interface       On return, a pointer to the first interface\r
+  @param ProtocolGuid    Provides the protocol to search for\r
+  @param Interface       On return, a pointer to the first interface\r
                          that matches ProtocolGuid\r
 \r
   @retval  EFI_SUCCESS      A protocol instance matching ProtocolGuid was found\r
@@ -131,6 +102,7 @@ EfiLibOpenRoot (
 \r
   @retval  TRUE  if the buffer was reallocated and the caller\r
                  should try the API again.\r
+  @retval  FALSE The caller should not call this function again.\r
 \r
 **/\r
 BOOLEAN\r
@@ -156,7 +128,7 @@ EfiGrowBuffer (
 \r
     SafeFreePool (*Buffer);\r
 \r
-    *Buffer = EfiAllocateZeroPool (BufferSize);\r
+    *Buffer = AllocateZeroPool (BufferSize);\r
 \r
     if (*Buffer != NULL) {\r
       TryAgain = TRUE;\r
@@ -179,11 +151,12 @@ EfiGrowBuffer (
   Function returns the value of the specified variable.\r
 \r
 \r
-  @param Name            A Null-terminated Unicode string that is\r
+  @param Name            A Null-terminated Unicode string that is\r
                          the name of the vendor's variable.\r
-  @param VendorGuid      A unique identifier for the vendor.\r
+  @param VendorGuid      A unique identifier for the vendor.\r
 \r
   @return               The payload of the variable.\r
+  @retval NULL          If the variable can't be read.\r
 \r
 **/\r
 VOID *\r
@@ -244,7 +217,8 @@ EfiLibDeleteVariable (
 \r
   @param FHand           The file handle.\r
 \r
-  @return                A pointer to a buffer with file information or NULL is returned\r
+  @return                A pointer to a buffer with file information.\r
+  @retval                NULL is returned if failed to get Vaolume Label Info.\r
 \r
 **/\r
 EFI_FILE_SYSTEM_VOLUME_LABEL_INFO *\r
@@ -282,7 +256,7 @@ EfiLibFileSystemVolumeLabelInfo (
   @param Src             The source.\r
 \r
   @return A new string which is duplicated copy of the source.\r
-  @retval NULL If there is not enought memory.\r
+  @retval NULL If there is not enough memory.\r
 \r
 **/\r
 CHAR16 *\r
@@ -294,7 +268,7 @@ EfiStrDuplicate (
   UINTN   Size;\r
 \r
   Size  = StrSize (Src);\r
-  Dest  = EfiAllocateZeroPool (Size);\r
+  Dest  = AllocateZeroPool (Size);\r
   ASSERT (Dest != NULL);\r
   if (Dest != NULL) {\r
     CopyMem (Dest, Src, Size);\r
@@ -348,7 +322,7 @@ EfiLibFileInfo (
   that exist in a device path.\r
 \r
 \r
-  @param DevicePath      A pointer to a device path data structure.\r
+  @param DevicePath      A pointer to a device path data structure.\r
 \r
   @return This function counts and returns the number of device path instances\r
           in DevicePath.\r
@@ -378,9 +352,8 @@ EfiDevicePathInstanceCount (
   @param OldSize         - The size of the current buffer.\r
   @param NewSize         - The size of the new buffer.\r
 \r
-  @retval  EFI_SUCEESS            The requested number of bytes were allocated.\r
-  @retval  EFI_OUT_OF_RESOURCES   The pool requested could not be allocated.\r
-  @retval  EFI_INVALID_PARAMETER  The buffer was invalid.\r
+  @return   The newly allocated buffer.\r
+  @retval   NULL  Allocation failed.\r
 \r
 **/\r
 VOID *\r
@@ -394,7 +367,7 @@ EfiReallocatePool (
 \r
   NewPool = NULL;\r
   if (NewSize != 0) {\r
-    NewPool = EfiAllocateZeroPool (NewSize);\r
+    NewPool = AllocateZeroPool (NewSize);\r
   }\r
 \r
   if (OldPool != NULL) {\r
@@ -450,6 +423,7 @@ TimeCompare (
 \r
   @return A string located from the Data Hub records based on\r
           the device path.\r
+  @retval NULL  If failed to get the String from Data Hub.\r
 \r
 **/\r
 UINT16 *\r