MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg 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
7c7184e201
commit
1436aea4d5
@@ -29,12 +29,12 @@ typedef struct {
|
||||
///
|
||||
/// A unique GUID identifying the firmware image type.
|
||||
///
|
||||
EFI_GUID ImageTypeGuid;
|
||||
EFI_GUID ImageTypeGuid;
|
||||
///
|
||||
/// An optional number to identify the unique hardware instance within the
|
||||
/// system for devices that may have multiple instances whenever possible.
|
||||
///
|
||||
UINT64 HardwareInstance;
|
||||
UINT64 HardwareInstance;
|
||||
} GUID_HARDWAREINSTANCE_PAIR;
|
||||
|
||||
/**
|
||||
@@ -59,10 +59,10 @@ PrintTable (
|
||||
**/
|
||||
EFI_STATUS
|
||||
InstallEfiSystemResourceTableInUefiConfigurationTable (
|
||||
IN EFI_SYSTEM_RESOURCE_TABLE *Table
|
||||
IN EFI_SYSTEM_RESOURCE_TABLE *Table
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
if (Table->FwResourceCount == 0) {
|
||||
@@ -79,6 +79,7 @@ InstallEfiSystemResourceTableInUefiConfigurationTable (
|
||||
DEBUG ((DEBUG_INFO, "EsrtFmpDxe: Installed ESRT table. \n"));
|
||||
}
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -100,7 +101,7 @@ IsSystemFmp (
|
||||
UINTN Index;
|
||||
|
||||
Guid = PcdGetPtr (PcdSystemFmpCapsuleImageTypeIdGuid);
|
||||
Count = PcdGetSize (PcdSystemFmpCapsuleImageTypeIdGuid) / sizeof(GUID);
|
||||
Count = PcdGetSize (PcdSystemFmpCapsuleImageTypeIdGuid) / sizeof (GUID);
|
||||
|
||||
for (Index = 0; Index < Count; Index++, Guid++) {
|
||||
if (CompareGuid (&FmpImageInfo->ImageTypeId, Guid)) {
|
||||
@@ -171,7 +172,7 @@ CreateEsrtEntry (
|
||||
//
|
||||
CopyGuid (&HardwareInstances[*NumberOfDescriptors].ImageTypeGuid, &FmpImageInfoBuf->ImageTypeId);
|
||||
HardwareInstances[*NumberOfDescriptors].HardwareInstance = FmpHardwareInstance;
|
||||
*NumberOfDescriptors = *NumberOfDescriptors + 1;
|
||||
*NumberOfDescriptors = *NumberOfDescriptors + 1;
|
||||
|
||||
DEBUG ((DEBUG_INFO, "EsrtFmpDxe: Add new image descriptor with GUID %g HardwareInstance:0x%x\n", &FmpImageInfoBuf->ImageTypeId, FmpHardwareInstance));
|
||||
|
||||
@@ -183,6 +184,7 @@ CreateEsrtEntry (
|
||||
if (!CompareGuid (&Entry->FwClass, &FmpImageInfoBuf->ImageTypeId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG ((DEBUG_INFO, "EsrtFmpDxe: ESRT Entry already exists for FMP Instance with GUID %g\n", &Entry->FwClass));
|
||||
|
||||
//
|
||||
@@ -216,7 +218,7 @@ CreateEsrtEntry (
|
||||
//
|
||||
if (Entry->LastAttemptStatus == LAST_ATTEMPT_STATUS_SUCCESS) {
|
||||
if (FmpImageInfoBuf->LastAttemptStatus != LAST_ATTEMPT_STATUS_SUCCESS) {
|
||||
Entry->LastAttemptStatus = FmpImageInfoBuf->LastAttemptStatus;
|
||||
Entry->LastAttemptStatus = FmpImageInfoBuf->LastAttemptStatus;
|
||||
Entry->LastAttemptVersion = FmpImageInfoBuf->LastAttemptVersion;
|
||||
} else {
|
||||
Entry->LastAttemptVersion =
|
||||
@@ -306,16 +308,16 @@ FmpGetFirmwareImageDescriptor (
|
||||
EFI_FIRMWARE_IMAGE_DESCRIPTOR *FmpImageInfoBuf;
|
||||
|
||||
ImageInfoSize = 0;
|
||||
Status = Fmp->GetImageInfo (
|
||||
Fmp, // FMP Pointer
|
||||
&ImageInfoSize, // Buffer Size (in this case 0)
|
||||
NULL, // NULL so we can get size
|
||||
FmpImageInfoDescriptorVer, // DescriptorVersion
|
||||
FmpImageInfoCount, // DescriptorCount
|
||||
DescriptorSize, // DescriptorSize
|
||||
&PackageVersion, // PackageVersion
|
||||
&PackageVersionName // PackageVersionName
|
||||
);
|
||||
Status = Fmp->GetImageInfo (
|
||||
Fmp, // FMP Pointer
|
||||
&ImageInfoSize, // Buffer Size (in this case 0)
|
||||
NULL, // NULL so we can get size
|
||||
FmpImageInfoDescriptorVer, // DescriptorVersion
|
||||
FmpImageInfoCount, // DescriptorCount
|
||||
DescriptorSize, // DescriptorSize
|
||||
&PackageVersion, // PackageVersion
|
||||
&PackageVersionName // PackageVersionName
|
||||
);
|
||||
if (Status != EFI_BUFFER_TOO_SMALL) {
|
||||
DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Unexpected Failure in GetImageInfo. Status = %r\n", Status));
|
||||
return NULL;
|
||||
@@ -328,19 +330,20 @@ FmpGetFirmwareImageDescriptor (
|
||||
}
|
||||
|
||||
PackageVersionName = NULL;
|
||||
Status = Fmp->GetImageInfo (
|
||||
Fmp, // FMP Pointer
|
||||
&ImageInfoSize, // ImageInfoSize
|
||||
FmpImageInfoBuf, // ImageInfo
|
||||
FmpImageInfoDescriptorVer, // DescriptorVersion
|
||||
FmpImageInfoCount, // DescriptorCount
|
||||
DescriptorSize, // DescriptorSize
|
||||
&PackageVersion, // PackageVersion
|
||||
&PackageVersionName // PackageVersionName
|
||||
);
|
||||
Status = Fmp->GetImageInfo (
|
||||
Fmp, // FMP Pointer
|
||||
&ImageInfoSize, // ImageInfoSize
|
||||
FmpImageInfoBuf, // ImageInfo
|
||||
FmpImageInfoDescriptorVer, // DescriptorVersion
|
||||
FmpImageInfoCount, // DescriptorCount
|
||||
DescriptorSize, // DescriptorSize
|
||||
&PackageVersion, // PackageVersion
|
||||
&PackageVersionName // PackageVersionName
|
||||
);
|
||||
if (PackageVersionName != NULL) {
|
||||
FreePool (PackageVersionName);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failure in GetImageInfo. Status = %r\n", Status));
|
||||
FreePool (FmpImageInfoBuf);
|
||||
@@ -389,7 +392,7 @@ CreateFmpBasedEsrt (
|
||||
&NoProtocols,
|
||||
&Buffer
|
||||
);
|
||||
if (EFI_ERROR(Status) || (Buffer == NULL)) {
|
||||
if (EFI_ERROR (Status) || (Buffer == NULL)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -398,7 +401,7 @@ CreateFmpBasedEsrt (
|
||||
//
|
||||
for (Index = 0, NumberOfDescriptors = 0; Index < NoProtocols; Index++) {
|
||||
FmpImageInfoBuf = FmpGetFirmwareImageDescriptor (
|
||||
(EFI_FIRMWARE_MANAGEMENT_PROTOCOL *) Buffer[Index],
|
||||
(EFI_FIRMWARE_MANAGEMENT_PROTOCOL *)Buffer[Index],
|
||||
&FmpImageInfoDescriptorVer,
|
||||
&FmpImageInfoCount,
|
||||
&DescriptorSize
|
||||
@@ -413,8 +416,8 @@ CreateFmpBasedEsrt (
|
||||
// Allocate ESRT Table and GUID/HardwareInstance table
|
||||
//
|
||||
Table = AllocateZeroPool (
|
||||
(NumberOfDescriptors * sizeof (EFI_SYSTEM_RESOURCE_ENTRY)) + sizeof (EFI_SYSTEM_RESOURCE_TABLE)
|
||||
);
|
||||
(NumberOfDescriptors * sizeof (EFI_SYSTEM_RESOURCE_ENTRY)) + sizeof (EFI_SYSTEM_RESOURCE_TABLE)
|
||||
);
|
||||
if (Table == NULL) {
|
||||
DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to allocate memory for ESRT.\n"));
|
||||
FreePool (Buffer);
|
||||
@@ -439,7 +442,7 @@ CreateFmpBasedEsrt (
|
||||
NumberOfDescriptors = 0;
|
||||
for (Index = 0; Index < NoProtocols; Index++) {
|
||||
FmpImageInfoBuf = FmpGetFirmwareImageDescriptor (
|
||||
(EFI_FIRMWARE_MANAGEMENT_PROTOCOL *) Buffer[Index],
|
||||
(EFI_FIRMWARE_MANAGEMENT_PROTOCOL *)Buffer[Index],
|
||||
&FmpImageInfoDescriptorVer,
|
||||
&FmpImageInfoCount,
|
||||
&DescriptorSize
|
||||
@@ -462,6 +465,7 @@ CreateFmpBasedEsrt (
|
||||
//
|
||||
CreateEsrtEntry (Table, HardwareInstances, &NumberOfDescriptors, FmpImageInfoBuf, FmpImageInfoDescriptorVer);
|
||||
}
|
||||
|
||||
FmpImageInfoCount--;
|
||||
//
|
||||
// Increment the buffer pointer ahead by the size of the descriptor
|
||||
|
@@ -47,21 +47,21 @@ PrintOutEsrtEntry (
|
||||
// Entry Type (12 chars plus table formatting)
|
||||
//
|
||||
switch (Entry->FwType) {
|
||||
case (ESRT_FW_TYPE_SYSTEMFIRMWARE) :
|
||||
DEBUG ((DEBUG_INFO, " System FW |"));
|
||||
break;
|
||||
case (ESRT_FW_TYPE_DEVICEFIRMWARE) :
|
||||
DEBUG ((DEBUG_INFO, " Device FW |"));
|
||||
break;
|
||||
case (ESRT_FW_TYPE_UEFIDRIVER) :
|
||||
DEBUG ((DEBUG_INFO, " Uefi Driver |"));
|
||||
break;
|
||||
case (ESRT_FW_TYPE_UNKNOWN) :
|
||||
DEBUG ((DEBUG_INFO, " Unknown Type |"));
|
||||
break;
|
||||
default:
|
||||
DEBUG ((DEBUG_INFO, " ? 0x%8X |", Entry->FwType));
|
||||
break;
|
||||
case (ESRT_FW_TYPE_SYSTEMFIRMWARE):
|
||||
DEBUG ((DEBUG_INFO, " System FW |"));
|
||||
break;
|
||||
case (ESRT_FW_TYPE_DEVICEFIRMWARE):
|
||||
DEBUG ((DEBUG_INFO, " Device FW |"));
|
||||
break;
|
||||
case (ESRT_FW_TYPE_UEFIDRIVER):
|
||||
DEBUG ((DEBUG_INFO, " Uefi Driver |"));
|
||||
break;
|
||||
case (ESRT_FW_TYPE_UNKNOWN):
|
||||
DEBUG ((DEBUG_INFO, " Unknown Type |"));
|
||||
break;
|
||||
default:
|
||||
DEBUG ((DEBUG_INFO, " ? 0x%8X |", Entry->FwType));
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -71,7 +71,8 @@ PrintOutEsrtEntry (
|
||||
// Last Attempt Version (10 char UINT32 string plus table formatting)
|
||||
// Last Attempt Status (10 char UINT32 string plus table formatting)
|
||||
//
|
||||
DEBUG ((DEBUG_INFO,
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
" 0x%8X | 0x%8X | 0x%8X | 0x%8X | 0x%8X |\n",
|
||||
Entry->FwVersion,
|
||||
Entry->LowestSupportedFwVersion,
|
||||
@@ -109,9 +110,9 @@ PrintTable (
|
||||
}
|
||||
|
||||
DEBUG ((DEBUG_INFO, "+--------------------------------------------------------+\n"));
|
||||
DEBUG ((DEBUG_INFO, "| Firmware Resource Count : 0x%08x |\n", Table->FwResourceCount));
|
||||
DEBUG ((DEBUG_INFO, "| Firmware Resource Count Max : 0x%08x |\n", Table->FwResourceCountMax));
|
||||
DEBUG ((DEBUG_INFO, "| Firmware Resource Entry Version : 0x%016x |\n", Table->FwResourceVersion));
|
||||
DEBUG ((DEBUG_INFO, "| Firmware Resource Count : 0x%08x |\n", Table->FwResourceCount));
|
||||
DEBUG ((DEBUG_INFO, "| Firmware Resource Count Max : 0x%08x |\n", Table->FwResourceCountMax));
|
||||
DEBUG ((DEBUG_INFO, "| Firmware Resource Entry Version : 0x%016x |\n", Table->FwResourceVersion));
|
||||
DEBUG ((DEBUG_INFO, "+--------------------------------------------------------+\n"));
|
||||
|
||||
//
|
||||
@@ -141,4 +142,3 @@ PrintTable (
|
||||
DEBUG ((DEBUG_INFO, "+--------------------------------------+--------------+------------"));
|
||||
DEBUG ((DEBUG_INFO, "+------------+------------+------------+------------+\n"));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user