MdePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdePkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
committed by
mergify[bot]
parent
1436aea4d5
commit
2f88bd3a12
@ -7,10 +7,8 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include <Uefi.h>
|
||||
|
||||
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
@ -46,7 +44,8 @@ InternalAllocatePages (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return NULL;
|
||||
}
|
||||
return (VOID *) (UINTN) Memory;
|
||||
|
||||
return (VOID *)(UINTN)Memory;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,7 +141,7 @@ FreePages (
|
||||
EFI_STATUS Status;
|
||||
|
||||
ASSERT (Pages != 0);
|
||||
Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
|
||||
Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Buffer, Pages);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
@ -186,23 +185,25 @@ InternalAllocateAlignedPages (
|
||||
if (Pages == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (Alignment > EFI_PAGE_SIZE) {
|
||||
//
|
||||
// Calculate the total number of pages since alignment is larger than page size.
|
||||
//
|
||||
AlignmentMask = Alignment - 1;
|
||||
RealPages = Pages + EFI_SIZE_TO_PAGES (Alignment);
|
||||
AlignmentMask = Alignment - 1;
|
||||
RealPages = Pages + EFI_SIZE_TO_PAGES (Alignment);
|
||||
//
|
||||
// Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.
|
||||
//
|
||||
ASSERT (RealPages > Pages);
|
||||
|
||||
Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory);
|
||||
Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return NULL;
|
||||
}
|
||||
AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask;
|
||||
UnalignedPages = EFI_SIZE_TO_PAGES (AlignedMemory - (UINTN) Memory);
|
||||
|
||||
AlignedMemory = ((UINTN)Memory + AlignmentMask) & ~AlignmentMask;
|
||||
UnalignedPages = EFI_SIZE_TO_PAGES (AlignedMemory - (UINTN)Memory);
|
||||
if (UnalignedPages > 0) {
|
||||
//
|
||||
// Free first unaligned page(s).
|
||||
@ -210,6 +211,7 @@ InternalAllocateAlignedPages (
|
||||
Status = gBS->FreePages (Memory, UnalignedPages);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
Memory = AlignedMemory + EFI_PAGES_TO_SIZE (Pages);
|
||||
UnalignedPages = RealPages - Pages - UnalignedPages;
|
||||
if (UnalignedPages > 0) {
|
||||
@ -227,9 +229,11 @@ InternalAllocateAlignedPages (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return NULL;
|
||||
}
|
||||
AlignedMemory = (UINTN) Memory;
|
||||
|
||||
AlignedMemory = (UINTN)Memory;
|
||||
}
|
||||
return (VOID *) AlignedMemory;
|
||||
|
||||
return (VOID *)AlignedMemory;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -343,7 +347,7 @@ FreeAlignedPages (
|
||||
EFI_STATUS Status;
|
||||
|
||||
ASSERT (Pages != 0);
|
||||
Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
|
||||
Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Buffer, Pages);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
@ -373,6 +377,7 @@ InternalAllocatePool (
|
||||
if (EFI_ERROR (Status)) {
|
||||
Memory = NULL;
|
||||
}
|
||||
|
||||
return Memory;
|
||||
}
|
||||
|
||||
@ -465,6 +470,7 @@ InternalAllocateZeroPool (
|
||||
if (Memory != NULL) {
|
||||
Memory = ZeroMem (Memory, AllocationSize);
|
||||
}
|
||||
|
||||
return Memory;
|
||||
}
|
||||
|
||||
@ -561,12 +567,13 @@ InternalAllocateCopyPool (
|
||||
VOID *Memory;
|
||||
|
||||
ASSERT (Buffer != NULL);
|
||||
ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1));
|
||||
ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN)Buffer + 1));
|
||||
|
||||
Memory = InternalAllocatePool (PoolType, AllocationSize);
|
||||
if (Memory != NULL) {
|
||||
Memory = CopyMem (Memory, Buffer, AllocationSize);
|
||||
Memory = CopyMem (Memory, Buffer, AllocationSize);
|
||||
}
|
||||
|
||||
return Memory;
|
||||
}
|
||||
|
||||
@ -684,10 +691,11 @@ InternalReallocatePool (
|
||||
VOID *NewBuffer;
|
||||
|
||||
NewBuffer = InternalAllocateZeroPool (PoolType, NewSize);
|
||||
if (NewBuffer != NULL && OldBuffer != NULL) {
|
||||
if ((NewBuffer != NULL) && (OldBuffer != NULL)) {
|
||||
CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize));
|
||||
FreePool (OldBuffer);
|
||||
}
|
||||
|
||||
return NewBuffer;
|
||||
}
|
||||
|
||||
@ -804,12 +812,11 @@ ReallocateReservedPool (
|
||||
VOID
|
||||
EFIAPI
|
||||
FreePool (
|
||||
IN VOID *Buffer
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = gBS->FreePool (Buffer);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user