diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:54:02 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 1436aea4d5707e672672a11bda72be2c63c936c3 (patch) | |
tree | 370c9d5bd8823aa8ea7bce71a0f29bff71feff67 /MdeModulePkg/Library/DxeReportStatusCodeLib | |
parent | 7c7184e201a90a1d2376e615e55e3f4074731468 (diff) | |
download | edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.gz edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.bz2 edk2-1436aea4d5707e672672a11bda72be2c63c936c3.zip |
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>
Diffstat (limited to 'MdeModulePkg/Library/DxeReportStatusCodeLib')
-rw-r--r-- | MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c index 92559a54f3..ed01d8aacb 100644 --- a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c @@ -47,8 +47,8 @@ InternalGetReportStatusCode ( //
// Check gBS just in case ReportStatusCode is called before gBS is initialized.
//
- if (gBS != NULL && gBS->LocateProtocol != NULL) {
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**) &mReportStatusCodeLibStatusCodeProtocol);
+ if ((gBS != NULL) && (gBS->LocateProtocol != NULL)) {
+ Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&mReportStatusCodeLibStatusCodeProtocol);
if (EFI_ERROR (Status)) {
mReportStatusCodeLibStatusCodeProtocol = NULL;
}
@@ -80,16 +80,17 @@ InternalGetReportStatusCode ( **/
EFI_STATUS
InternalReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
+ IN EFI_STATUS_CODE_TYPE Type,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN CONST EFI_GUID *CallerId OPTIONAL,
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL
)
{
- if ((ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||
- (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ||
- (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE)) {
+ if ((ReportProgressCodeEnabled () && (((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE)) ||
+ (ReportErrorCodeEnabled () && (((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE)) ||
+ (ReportDebugCodeEnabled () && (((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE)))
+ {
//
// If mReportStatusCodeLibStatusCodeProtocol is NULL, then check if Report Status Code Protocol is available in system.
//
@@ -107,7 +108,6 @@ InternalReportStatusCode ( return EFI_UNSUPPORTED;
}
-
/**
Converts a status code to an 8-bit POST code value.
@@ -146,15 +146,16 @@ CodeTypeToPostCode ( // Convert Value to an 8 bit post code
//
if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||
- ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ) {
- *PostCode = (UINT8) ((((Value & EFI_STATUS_CODE_CLASS_MASK) >> 24) << 5) |
- (((Value & EFI_STATUS_CODE_SUBCLASS_MASK) >> 16) & 0x1f));
+ ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE))
+ {
+ *PostCode = (UINT8)((((Value & EFI_STATUS_CODE_CLASS_MASK) >> 24) << 5) |
+ (((Value & EFI_STATUS_CODE_SUBCLASS_MASK) >> 16) & 0x1f));
return TRUE;
}
+
return FALSE;
}
-
/**
Extracts ASSERT() information from a status code structure.
@@ -208,17 +209,18 @@ ReportStatusCodeExtractAssertInfo ( if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) &&
((CodeType & EFI_STATUS_CODE_SEVERITY_MASK) == EFI_ERROR_UNRECOVERED) &&
- ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) {
+ ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE))
+ {
AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1);
*Filename = (CHAR8 *)(AssertData + 1);
*Description = *Filename + AsciiStrLen (*Filename) + 1;
*LineNumber = AssertData->LineNumber;
return TRUE;
}
+
return FALSE;
}
-
/**
Extracts DEBUG() information from a status code structure.
@@ -287,13 +289,12 @@ ReportStatusCodeExtractDebugInfo ( // 64-bit aligned is a must, otherwise retrieving 64-bit parameter from BASE_LIST will
// cause unalignment exception.
//
- *Marker = (BASE_LIST) (DebugInfo + 1);
+ *Marker = (BASE_LIST)(DebugInfo + 1);
*Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);
return TRUE;
}
-
/**
Reports a status code.
@@ -325,7 +326,6 @@ ReportStatusCode ( return InternalReportStatusCode (Type, Value, 0, &gEfiCallerIdGuid, NULL);
}
-
/**
Reports a status code with a Device Path Protocol as the extended data.
@@ -371,7 +371,6 @@ ReportStatusCodeWithDevicePath ( );
}
-
/**
Reports a status code with an extended data buffer.
@@ -427,7 +426,6 @@ ReportStatusCodeWithExtendedData ( );
}
-
/**
Reports a status code with full parameters.
@@ -496,7 +494,7 @@ ReportStatusCodeEx ( //
StatusCodeData = (EFI_STATUS_CODE_DATA *)Buffer;
} else {
- if (gBS == NULL || gBS->AllocatePool == NULL || gBS->FreePool == NULL) {
+ if ((gBS == NULL) || (gBS->AllocatePool == NULL) || (gBS->FreePool == NULL)) {
return EFI_UNSUPPORTED;
}
@@ -523,11 +521,12 @@ ReportStatusCodeEx ( //
// Fill in the extended data header
//
- StatusCodeData->HeaderSize = (UINT16) sizeof (EFI_STATUS_CODE_DATA);
- StatusCodeData->Size = (UINT16) ExtendedDataSize;
+ StatusCodeData->HeaderSize = (UINT16)sizeof (EFI_STATUS_CODE_DATA);
+ StatusCodeData->Size = (UINT16)ExtendedDataSize;
if (ExtendedDataGuid == NULL) {
ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;
}
+
CopyGuid (&StatusCodeData->Type, ExtendedDataGuid);
//
@@ -543,6 +542,7 @@ ReportStatusCodeEx ( if (CallerId == NULL) {
CallerId = &gEfiCallerIdGuid;
}
+
Status = InternalReportStatusCode (Type, Value, Instance, CallerId, StatusCodeData);
//
@@ -555,7 +555,6 @@ ReportStatusCodeEx ( return Status;
}
-
/**
Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
@@ -574,10 +573,9 @@ ReportProgressCodeEnabled ( VOID
)
{
- return (BOOLEAN) ((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED) != 0);
+ return (BOOLEAN)((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED) != 0);
}
-
/**
Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
@@ -596,10 +594,9 @@ ReportErrorCodeEnabled ( VOID
)
{
- return (BOOLEAN) ((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED) != 0);
+ return (BOOLEAN)((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED) != 0);
}
-
/**
Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
@@ -618,5 +615,5 @@ ReportDebugCodeEnabled ( VOID
)
{
- return (BOOLEAN) ((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED) != 0);
+ return (BOOLEAN)((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED) != 0);
}
|