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:
Michael Kubacki
2021-12-05 14:54:02 -08:00
committed by mergify[bot]
parent 7c7184e201
commit 1436aea4d5
994 changed files with 107608 additions and 101311 deletions

View File

@ -21,16 +21,16 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
typedef
EFI_STATUS
(EFIAPI *INTERNAL_VAR_CHECK_FUNCTION) (
(EFIAPI *INTERNAL_VAR_CHECK_FUNCTION)(
IN VAR_CHECK_VARIABLE_PROPERTY *Propery,
IN UINTN DataSize,
IN VOID *Data
);
typedef struct {
CHAR16 *Name;
VAR_CHECK_VARIABLE_PROPERTY VariableProperty;
INTERNAL_VAR_CHECK_FUNCTION CheckFunction;
CHAR16 *Name;
VAR_CHECK_VARIABLE_PROPERTY VariableProperty;
INTERNAL_VAR_CHECK_FUNCTION CheckFunction;
} UEFI_DEFINED_VARIABLE_ENTRY;
/**
@ -47,45 +47,51 @@ typedef struct {
EFI_STATUS
EFIAPI
InternalVarCheckLoadOption (
IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery,
IN UINTN DataSize,
IN VOID *Data
IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery,
IN UINTN DataSize,
IN VOID *Data
)
{
UINT16 FilePathListLength;
CHAR16 *Description;
EFI_DEVICE_PATH_PROTOCOL *FilePathList;
FilePathListLength = *((UINT16 *) ((UINTN) Data + sizeof (UINT32)));
FilePathListLength = *((UINT16 *)((UINTN)Data + sizeof (UINT32)));
//
// Check Description
//
Description = (CHAR16 *) ((UINTN) Data + sizeof (UINT32) + sizeof (UINT16));
while (Description < (CHAR16 *) ((UINTN) Data + DataSize)) {
Description = (CHAR16 *)((UINTN)Data + sizeof (UINT32) + sizeof (UINT16));
while (Description < (CHAR16 *)((UINTN)Data + DataSize)) {
if (*Description == L'\0') {
break;
}
Description++;
}
if ((UINTN) Description >= ((UINTN) Data + DataSize)) {
if ((UINTN)Description >= ((UINTN)Data + DataSize)) {
return EFI_INVALID_PARAMETER;
}
Description++;
//
// Check FilePathList
//
FilePathList = (EFI_DEVICE_PATH_PROTOCOL *) Description;
if ((UINTN) FilePathList > (MAX_ADDRESS - FilePathListLength)) {
FilePathList = (EFI_DEVICE_PATH_PROTOCOL *)Description;
if ((UINTN)FilePathList > (MAX_ADDRESS - FilePathListLength)) {
return EFI_INVALID_PARAMETER;
}
if (((UINTN) FilePathList + FilePathListLength) > ((UINTN) Data + DataSize)) {
if (((UINTN)FilePathList + FilePathListLength) > ((UINTN)Data + DataSize)) {
return EFI_INVALID_PARAMETER;
}
if (FilePathListLength < sizeof (EFI_DEVICE_PATH_PROTOCOL)) {
return EFI_INVALID_PARAMETER;
}
if (!IsDevicePathValid (FilePathList, FilePathListLength)) {
return EFI_INVALID_PARAMETER;
}
@ -107,9 +113,9 @@ InternalVarCheckLoadOption (
EFI_STATUS
EFIAPI
InternalVarCheckKeyOption (
IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery,
IN UINTN DataSize,
IN VOID *Data
IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery,
IN UINTN DataSize,
IN VOID *Data
)
{
if (((DataSize - sizeof (EFI_KEY_OPTION)) % sizeof (EFI_INPUT_KEY)) != 0) {
@ -133,14 +139,15 @@ InternalVarCheckKeyOption (
EFI_STATUS
EFIAPI
InternalVarCheckDevicePath (
IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery,
IN UINTN DataSize,
IN VOID *Data
IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery,
IN UINTN DataSize,
IN VOID *Data
)
{
if (!IsDevicePathValid ((EFI_DEVICE_PATH_PROTOCOL *) Data, DataSize)) {
if (!IsDevicePathValid ((EFI_DEVICE_PATH_PROTOCOL *)Data, DataSize)) {
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
}
@ -158,23 +165,26 @@ InternalVarCheckDevicePath (
EFI_STATUS
EFIAPI
InternalVarCheckAsciiString (
IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery,
IN UINTN DataSize,
IN VOID *Data
IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery,
IN UINTN DataSize,
IN VOID *Data
)
{
CHAR8 *String;
UINTN Index;
CHAR8 *String;
UINTN Index;
String = (CHAR8 *) Data;
String = (CHAR8 *)Data;
if (String[DataSize - 1] == '\0') {
return EFI_SUCCESS;
} else {
for (Index = 1; Index < DataSize && (String[DataSize - 1 - Index] != '\0'); Index++);
for (Index = 1; Index < DataSize && (String[DataSize - 1 - Index] != '\0'); Index++) {
}
if (Index == DataSize) {
return EFI_INVALID_PARAMETER;
}
}
return EFI_SUCCESS;
}
@ -192,14 +202,15 @@ InternalVarCheckAsciiString (
EFI_STATUS
EFIAPI
InternalVarCheckSizeArray (
IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery,
IN UINTN DataSize,
IN VOID *Data
IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery,
IN UINTN DataSize,
IN VOID *Data
)
{
if ((DataSize % VariablePropery->MinSize) != 0) {
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
}
@ -211,7 +222,7 @@ InternalVarCheckSizeArray (
// only permit the creation of variables with a UEFI Specification-defined
// VendorGuid when these variables are documented in the UEFI Specification.
//
UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList[] = {
UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList[] = {
{
EFI_LANG_CODES_VARIABLE_NAME,
{
@ -555,7 +566,7 @@ UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList[] = {
},
};
UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList2[] = {
UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList2[] = {
{
L"Boot####",
{
@ -616,7 +627,7 @@ UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList2[] = {
//
// EFI_IMAGE_SECURITY_DATABASE_GUID
//
UEFI_DEFINED_VARIABLE_ENTRY mImageSecurityVariableList[] = {
UEFI_DEFINED_VARIABLE_ENTRY mImageSecurityVariableList[] = {
{
EFI_IMAGE_SECURITY_DATABASE,
{
@ -655,7 +666,7 @@ UEFI_DEFINED_VARIABLE_ENTRY mImageSecurityVariableList[] = {
//
// EFI_HARDWARE_ERROR_VARIABLE
//
UEFI_DEFINED_VARIABLE_ENTRY mHwErrRecVariable = {
UEFI_DEFINED_VARIABLE_ENTRY mHwErrRecVariable = {
L"HwErrRec####",
{
VAR_CHECK_VARIABLE_PROPERTY_REVISION,
@ -667,7 +678,7 @@ UEFI_DEFINED_VARIABLE_ENTRY mHwErrRecVariable = {
NULL
};
EFI_GUID *mUefiDefinedGuid[] = {
EFI_GUID *mUefiDefinedGuid[] = {
&gEfiGlobalVariableGuid,
&gEfiImageSecurityDatabaseGuid,
&gEfiHardwareErrorVariableGuid
@ -690,10 +701,10 @@ EFI_GUID *mUefiDefinedGuid[] = {
BOOLEAN
EFIAPI
VarCheckUefiIsHexaDecimalDigitCharacter (
IN CHAR16 Char
IN CHAR16 Char
)
{
return (BOOLEAN) ((Char >= L'0' && Char <= L'9') || (Char >= L'A' && Char <= L'F'));
return (BOOLEAN)((Char >= L'0' && Char <= L'9') || (Char >= L'A' && Char <= L'F'));
}
/**
@ -713,17 +724,18 @@ VarCheckUefiIsHexaDecimalDigitCharacter (
BOOLEAN
EFIAPI
IsHwErrRecVariable (
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid
)
{
if (!CompareGuid (VendorGuid, &gEfiHardwareErrorVariableGuid) ||
(StrLen (VariableName) != StrLen (L"HwErrRec####")) ||
(StrnCmp(VariableName, L"HwErrRec", StrLen (L"HwErrRec")) != 0) ||
(StrnCmp (VariableName, L"HwErrRec", StrLen (L"HwErrRec")) != 0) ||
!VarCheckUefiIsHexaDecimalDigitCharacter (VariableName[0x8]) ||
!VarCheckUefiIsHexaDecimalDigitCharacter (VariableName[0x9]) ||
!VarCheckUefiIsHexaDecimalDigitCharacter (VariableName[0xA]) ||
!VarCheckUefiIsHexaDecimalDigitCharacter (VariableName[0xB])) {
!VarCheckUefiIsHexaDecimalDigitCharacter (VariableName[0xB]))
{
return FALSE;
}
@ -742,13 +754,13 @@ IsHwErrRecVariable (
**/
INTERNAL_VAR_CHECK_FUNCTION
GetUefiDefinedVarCheckFunction (
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
OUT VAR_CHECK_VARIABLE_PROPERTY **VariableProperty
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
OUT VAR_CHECK_VARIABLE_PROPERTY **VariableProperty
)
{
UINTN Index;
UINTN NameLength;
UINTN Index;
UINTN NameLength;
if (CompareGuid (VendorGuid, &gEfiGlobalVariableGuid)) {
//
@ -771,7 +783,8 @@ GetUefiDefinedVarCheckFunction (
VarCheckUefiIsHexaDecimalDigitCharacter (VariableName[NameLength]) &&
VarCheckUefiIsHexaDecimalDigitCharacter (VariableName[NameLength + 1]) &&
VarCheckUefiIsHexaDecimalDigitCharacter (VariableName[NameLength + 2]) &&
VarCheckUefiIsHexaDecimalDigitCharacter (VariableName[NameLength + 3])) {
VarCheckUefiIsHexaDecimalDigitCharacter (VariableName[NameLength + 3]))
{
*VariableProperty = &(mGlobalVariableList2[Index].VariableProperty);
return mGlobalVariableList2[Index].CheckFunction;
}
@ -799,18 +812,18 @@ GetUefiDefinedVarCheckFunction (
EFI_STATUS
EFIAPI
SetVariableCheckHandlerUefiDefined (
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
IN UINT32 Attributes,
IN UINTN DataSize,
IN VOID *Data
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
IN UINT32 Attributes,
IN UINTN DataSize,
IN VOID *Data
)
{
EFI_STATUS Status;
UINTN Index;
VAR_CHECK_VARIABLE_PROPERTY Property;
VAR_CHECK_VARIABLE_PROPERTY *VarCheckProperty;
INTERNAL_VAR_CHECK_FUNCTION VarCheckFunction;
EFI_STATUS Status;
UINTN Index;
VAR_CHECK_VARIABLE_PROPERTY Property;
VAR_CHECK_VARIABLE_PROPERTY *VarCheckProperty;
INTERNAL_VAR_CHECK_FUNCTION VarCheckFunction;
if ((((Attributes & EFI_VARIABLE_APPEND_WRITE) == 0) && (DataSize == 0)) || (Attributes == 0)) {
//
@ -872,7 +885,7 @@ VariablePropertySetUefiDefined (
VOID
)
{
UINTN Index;
UINTN Index;
//
// EFI_GLOBAL_VARIABLE
@ -884,6 +897,7 @@ VariablePropertySetUefiDefined (
&mGlobalVariableList[Index].VariableProperty
);
}
for (Index = 0; Index < sizeof (mGlobalVariableList2)/sizeof (mGlobalVariableList2[0]); Index++) {
VarCheckLibVariablePropertySet (
mGlobalVariableList2[Index].Name,