]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkNt32Pkg/Dxe/WinNtThunk/Bus/WinNtBusDriver/WinNtBusDriver.c
1. Perfect libraries MSA files
[mirror_edk2.git] / EdkNt32Pkg / Dxe / WinNtThunk / Bus / WinNtBusDriver / WinNtBusDriver.c
index 1e2b3709009a865e01539885b5274406f3af9083..b0e1c2b8160b1715376e2f029ab6adec3e42c53c 100644 (file)
@@ -136,18 +136,11 @@ AllocateMemory (
   IN  UINTN   Size\r
   )\r
 {\r
-  EFI_STATUS  Status;\r
   VOID        *Buffer;\r
 \r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  Size,\r
-                  (VOID *)&Buffer\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    ASSERT (FALSE);\r
-    return NULL;\r
-  }\r
+  Buffer = AllocatePool (Size);\r
+  ASSERT (Buffer != NULL);\r
+\r
   return Buffer;\r
 }\r
 \r
@@ -341,13 +334,9 @@ Returns:
   }\r
 \r
   if (Status != EFI_ALREADY_STARTED) {\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    sizeof (WIN_NT_BUS_DEVICE),\r
-                    (VOID *) &WinNtBusDevice\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
+    WinNtBusDevice = AllocatePool (sizeof (WIN_NT_BUS_DEVICE));\r
+    if (WinNtBusDevice == NULL) {\r
+      return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
     WinNtBusDevice->Signature           = WIN_NT_BUS_DEVICE_SIGNATURE;\r
@@ -368,7 +357,7 @@ Returns:
                     );\r
     if (EFI_ERROR (Status)) {\r
       FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);\r
-      gBS->FreePool (WinNtBusDevice);\r
+      FreePool (WinNtBusDevice);\r
       return Status;\r
     }\r
   }\r
@@ -464,7 +453,7 @@ Returns:
                                     Count\r
                                     );\r
         if (WinNtDevice->DevicePath == NULL) {\r
-          gBS->FreePool (WinNtDevice);\r
+          FreePool (WinNtDevice);\r
           return EFI_OUT_OF_RESOURCES;\r
         }\r
 \r
@@ -490,7 +479,7 @@ Returns:
                         );\r
         if (EFI_ERROR (Status)) {\r
           FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);\r
-          gBS->FreePool (WinNtDevice);\r
+          FreePool (WinNtDevice);\r
         } else {\r
           //\r
           // Open For Child Device\r
@@ -516,7 +505,7 @@ Returns:
       StartString = SubString;\r
     }\r
 \r
-    gBS->FreePool (TempStr);\r
+    FreePool (TempStr);\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -588,7 +577,7 @@ Returns:
 \r
     FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);\r
 \r
-    gBS->FreePool (WinNtBusDevice);\r
+    FreePool (WinNtBusDevice);\r
 \r
     gBS->CloseProtocol (\r
           ControllerHandle,\r
@@ -652,7 +641,7 @@ Returns:
         // Close the child handle\r
         //\r
         FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);\r
-        gBS->FreePool (WinNtDevice);\r
+        FreePool (WinNtDevice);\r
       }\r
     }\r
 \r