]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/Ebc/Dxe/EbcInt.c
Perfect the msa of the following modules, DiskIo, Partition, English and Ebc.
[mirror_edk2.git] / EdkModulePkg / Universal / Ebc / Dxe / EbcInt.c
index cf683295ea03e65c189277180f2c45c727d1bf96..52f8d9fad787b5d68bde2633fe3bde230d5cd25f 100644 (file)
@@ -222,12 +222,9 @@ Returns:
   //\r
   // Allocate memory for our protocol. Then fill in the blanks.\r
   //\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (EFI_EBC_PROTOCOL),\r
-                  (VOID **) &EbcProtocol\r
-                  );\r
-  if (Status != EFI_SUCCESS) {\r
+  EbcProtocol = AllocatePool (sizeof (EFI_EBC_PROTOCOL));\r
+\r
+  if (EbcProtocol == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r
@@ -273,7 +270,7 @@ Returns:
   }\r
 \r
   if (HandleBuffer != NULL) {\r
-    gBS->FreePool (HandleBuffer);\r
+    FreePool (HandleBuffer);\r
     HandleBuffer = NULL;\r
   }\r
   //\r
@@ -287,19 +284,16 @@ Returns:
                     EbcProtocol\r
                     );\r
     if (EFI_ERROR (Status)) {\r
-      gBS->FreePool (EbcProtocol);\r
+      FreePool (EbcProtocol);\r
       return Status;\r
     }\r
   }\r
   //\r
   // Allocate memory for our debug protocol. Then fill in the blanks.\r
   //\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (EFI_DEBUG_SUPPORT_PROTOCOL),\r
-                  (VOID **) &EbcDebugProtocol\r
-                  );\r
-  if (Status != EFI_SUCCESS) {\r
+  EbcDebugProtocol = AllocatePool (sizeof (EFI_DEBUG_SUPPORT_PROTOCOL));\r
+\r
+  if (EbcDebugProtocol == NULL) {\r
     goto ErrorExit;\r
   }\r
 \r
@@ -322,7 +316,7 @@ Returns:
   // This is recoverable, so free the memory and continue.\r
   //\r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (EbcDebugProtocol);\r
+    FreePool (EbcDebugProtocol);\r
     goto ErrorExit;\r
   }\r
   //\r
@@ -370,11 +364,11 @@ ErrorExit:
   }\r
 \r
   if (HandleBuffer != NULL) {\r
-    gBS->FreePool (HandleBuffer);\r
+    FreePool (HandleBuffer);\r
     HandleBuffer = NULL;\r
   }\r
 \r
-  gBS->FreePool (EbcProtocol);\r
+  FreePool (EbcProtocol);\r
 \r
   return Status;\r
 }\r
@@ -894,8 +888,8 @@ Returns:
   ThunkList = ImageList->ThunkList;\r
   while (ThunkList != NULL) {\r
     NextThunkList = ThunkList->Next;\r
-    gBS->FreePool (ThunkList->ThunkBuffer);\r
-    gBS->FreePool (ThunkList);\r
+    FreePool (ThunkList->ThunkBuffer);\r
+    FreePool (ThunkList);\r
     ThunkList = NextThunkList;\r
   }\r
   //\r
@@ -912,7 +906,7 @@ Returns:
   //\r
   // Now free up the image list element\r
   //\r
-  gBS->FreePool (ImageList);\r
+  FreePool (ImageList);\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -970,12 +964,9 @@ Returns:
     //\r
     // Allocate a new one\r
     //\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    sizeof (EBC_IMAGE_LIST),\r
-                    (VOID **) &ImageList\r
-                    );\r
-    if (Status != EFI_SUCCESS) {\r
+    ImageList = AllocatePool (sizeof (EBC_IMAGE_LIST));\r
+\r
+    if (ImageList == NULL) {\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
@@ -987,12 +978,9 @@ Returns:
   //\r
   // Ok, now create a new thunk element to add to the list\r
   //\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (EBC_THUNK_LIST),\r
-                  (VOID **) &ThunkList\r
-                  );\r
-  if (Status != EFI_SUCCESS) {\r
+  ThunkList = AllocatePool (sizeof (EBC_THUNK_LIST));\r
+\r
+  if (ThunkList == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
   //\r
@@ -1061,8 +1049,8 @@ Returns:
   //\r
   // Allocate memory for the protocol, then fill in the fields\r
   //\r
-  Status = gBS->AllocatePool (EfiBootServicesData, sizeof (EFI_EBC_VM_TEST_PROTOCOL), (VOID **) &EbcVmTestProtocol);\r
-  if (Status != EFI_SUCCESS) {\r
+  EbcVmTestProtocol = AllocatePool (sizeof (EFI_EBC_VM_TEST_PROTOCOL));\r
+  if (EbcVmTestProtocol == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
   EbcVmTestProtocol->Execute      = (EBC_VM_TEST_EXECUTE) EbcExecuteInstructions;\r
@@ -1078,7 +1066,7 @@ Returns:
   Handle  = NULL;\r
   Status  = gBS->InstallProtocolInterface (&Handle, &mEfiEbcVmTestProtocolGuid, EFI_NATIVE_INTERFACE, EbcVmTestProtocol);\r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (EbcVmTestProtocol);\r
+    FreePool (EbcVmTestProtocol);\r
   }\r
   return Status;\r
 }\r