]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/LockBoxLib/LockBoxDxe.c
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Library / LockBoxLib / LockBoxDxe.c
index 7dc2eea2395a23ebe3dfa97419f3132250506840..c9d679cb840c39cecc42797a28e381debc38048b 100644 (file)
 STATIC\r
 VOID *\r
 AllocateMemoryBelow4G (\r
-  IN EFI_MEMORY_TYPE    MemoryType,\r
-  IN UINTN              Size\r
+  IN EFI_MEMORY_TYPE  MemoryType,\r
+  IN UINTN            Size\r
   )\r
 {\r
   UINTN                 Pages;\r
   EFI_PHYSICAL_ADDRESS  Address;\r
   EFI_STATUS            Status;\r
-  VOID*                 Buffer;\r
+  VOID                  *Buffer;\r
   UINTN                 AllocRemaining;\r
 \r
-  Pages = EFI_SIZE_TO_PAGES (Size);\r
+  Pages   = EFI_SIZE_TO_PAGES (Size);\r
   Address = 0xffffffff;\r
 \r
   //\r
@@ -49,36 +49,35 @@ AllocateMemoryBelow4G (
   // allocations, and use these to allocate memory for small buffers.\r
   //\r
   ASSERT (mLockBoxGlobal->Signature == LOCK_BOX_GLOBAL_SIGNATURE);\r
-  if ((UINTN) mLockBoxGlobal->SubPageRemaining >= Size) {\r
-    Buffer = (VOID*)(UINTN) mLockBoxGlobal->SubPageBuffer;\r
-    mLockBoxGlobal->SubPageBuffer += (UINT32) Size;\r
-    mLockBoxGlobal->SubPageRemaining -= (UINT32) Size;\r
+  if ((UINTN)mLockBoxGlobal->SubPageRemaining >= Size) {\r
+    Buffer                            = (VOID *)(UINTN)mLockBoxGlobal->SubPageBuffer;\r
+    mLockBoxGlobal->SubPageBuffer    += (UINT32)Size;\r
+    mLockBoxGlobal->SubPageRemaining -= (UINT32)Size;\r
     return Buffer;\r
   }\r
 \r
-  Status  = gBS->AllocatePages (\r
-                   AllocateMaxAddress,\r
-                   MemoryType,\r
-                   Pages,\r
-                   &Address\r
-                   );\r
+  Status = gBS->AllocatePages (\r
+                  AllocateMaxAddress,\r
+                  MemoryType,\r
+                  Pages,\r
+                  &Address\r
+                  );\r
   if (EFI_ERROR (Status)) {\r
     return NULL;\r
   }\r
 \r
-  Buffer = (VOID *) (UINTN) Address;\r
+  Buffer = (VOID *)(UINTN)Address;\r
   ZeroMem (Buffer, EFI_PAGES_TO_SIZE (Pages));\r
 \r
   AllocRemaining = EFI_PAGES_TO_SIZE (Pages) - Size;\r
-  if (AllocRemaining > (UINTN) mLockBoxGlobal->SubPageRemaining) {\r
-    mLockBoxGlobal->SubPageBuffer = (UINT32) (Address + Size);\r
-    mLockBoxGlobal->SubPageRemaining = (UINT32) AllocRemaining;\r
+  if (AllocRemaining > (UINTN)mLockBoxGlobal->SubPageRemaining) {\r
+    mLockBoxGlobal->SubPageBuffer    = (UINT32)(Address + Size);\r
+    mLockBoxGlobal->SubPageRemaining = (UINT32)AllocRemaining;\r
   }\r
 \r
   return Buffer;\r
 }\r
 \r
-\r
 /**\r
   Allocates a buffer of type EfiACPIMemoryNVS.\r
 \r
@@ -102,7 +101,6 @@ AllocateAcpiNvsPool (
   return AllocateMemoryBelow4G (EfiACPIMemoryNVS, AllocationSize);\r
 }\r
 \r
-\r
 EFI_STATUS\r
 EFIAPI\r
 LockBoxDxeLibInitialize (\r
@@ -110,8 +108,8 @@ LockBoxDxeLibInitialize (
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
-  EFI_STATUS    Status;\r
-  VOID          *Interface;\r
+  EFI_STATUS  Status;\r
+  VOID        *Interface;\r
 \r
   Status = LockBoxLibInitialize ();\r
   if (!EFI_ERROR (Status)) {\r