EmbeddedPkg/AcpiLib: Fix code formatting errors

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4046

This package did not have CI enabled so code changes were merged
that fail uncrustify formatting. This change updates those files
to include uncustify formatting.

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Daniel Schaefer <git@danielschaefer.me>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
Michael Kubacki 2022-09-02 20:52:36 -04:00 committed by mergify[bot]
parent f01d3ee12c
commit 51e0599536
2 changed files with 56 additions and 54 deletions

View File

@ -144,8 +144,8 @@ LocateAndInstallAcpiFromFv (
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
AcpiUpdateChecksum ( AcpiUpdateChecksum (
IN OUT UINT8 *Buffer, IN OUT UINT8 *Buffer,
IN UINTN Size IN UINTN Size
); );
/** /**
@ -168,11 +168,11 @@ AcpiUpdateChecksum (
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
AcpiLocateTableBySignature ( AcpiLocateTableBySignature (
IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol, IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
IN UINT32 TableSignature, IN UINT32 TableSignature,
IN OUT UINTN *Index, IN OUT UINTN *Index,
OUT EFI_ACPI_DESCRIPTION_HEADER **Table, OUT EFI_ACPI_DESCRIPTION_HEADER **Table,
OUT UINTN *TableKey OUT UINTN *TableKey
); );
/** /**
@ -193,10 +193,10 @@ AcpiLocateTableBySignature (
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
AcpiAmlObjectUpdateInteger ( AcpiAmlObjectUpdateInteger (
IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol, IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
IN EFI_ACPI_HANDLE TableHandle, IN EFI_ACPI_HANDLE TableHandle,
IN CHAR8 *AsciiObjectPath, IN CHAR8 *AsciiObjectPath,
IN UINTN Value IN UINTN Value
); );
#endif // __ACPI_LIB_H__ #endif // __ACPI_LIB_H__

View File

@ -192,13 +192,13 @@ LocateAndInstallAcpiFromFv (
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
AcpiUpdateChecksum ( AcpiUpdateChecksum (
IN OUT UINT8 *Buffer, IN OUT UINT8 *Buffer,
IN UINTN Size IN UINTN Size
) )
{ {
UINTN ChecksumOffset; UINTN ChecksumOffset;
if (Buffer == NULL || Size == 0) { if ((Buffer == NULL) || (Size == 0)) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -237,11 +237,11 @@ AcpiUpdateChecksum (
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
AcpiLocateTableBySignature ( AcpiLocateTableBySignature (
IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol, IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
IN UINT32 TableSignature, IN UINT32 TableSignature,
IN OUT UINTN *Index, IN OUT UINTN *Index,
OUT EFI_ACPI_DESCRIPTION_HEADER **Table, OUT EFI_ACPI_DESCRIPTION_HEADER **Table,
OUT UINTN *TableKey OUT UINTN *TableKey
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
@ -249,9 +249,10 @@ AcpiLocateTableBySignature (
EFI_ACPI_TABLE_VERSION TableVersion; EFI_ACPI_TABLE_VERSION TableVersion;
UINTN TableIndex; UINTN TableIndex;
if (AcpiSdtProtocol == NULL if ( (AcpiSdtProtocol == NULL)
|| Table == NULL || (Table == NULL)
|| TableKey == NULL) { || (TableKey == NULL))
{
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -261,7 +262,7 @@ AcpiLocateTableBySignature (
// Search for ACPI Table with matching signature // Search for ACPI Table with matching signature
// //
TableVersion = 0; TableVersion = 0;
TableIndex = *Index; TableIndex = *Index;
while (!EFI_ERROR (Status)) { while (!EFI_ERROR (Status)) {
Status = AcpiSdtProtocol->GetAcpiTable ( Status = AcpiSdtProtocol->GetAcpiTable (
TableIndex, TableIndex,
@ -301,26 +302,26 @@ AcpiLocateTableBySignature (
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
AcpiAmlObjectUpdateInteger ( AcpiAmlObjectUpdateInteger (
IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol, IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
IN EFI_ACPI_HANDLE TableHandle, IN EFI_ACPI_HANDLE TableHandle,
IN CHAR8 *AsciiObjectPath, IN CHAR8 *AsciiObjectPath,
IN UINTN Value IN UINTN Value
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_ACPI_HANDLE ObjectHandle; EFI_ACPI_HANDLE ObjectHandle;
EFI_ACPI_HANDLE DataHandle; EFI_ACPI_HANDLE DataHandle;
EFI_ACPI_DATA_TYPE DataType; EFI_ACPI_DATA_TYPE DataType;
UINT8 *Buffer; UINT8 *Buffer;
UINTN BufferSize; UINTN BufferSize;
UINTN DataSize; UINTN DataSize;
if (AcpiSdtProtocol == NULL || AsciiObjectPath == NULL) { if ((AcpiSdtProtocol == NULL) || (AsciiObjectPath == NULL)) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
ObjectHandle = NULL; ObjectHandle = NULL;
DataHandle = NULL; DataHandle = NULL;
Status = AcpiSdtProtocol->FindPath (TableHandle, AsciiObjectPath, &ObjectHandle); Status = AcpiSdtProtocol->FindPath (TableHandle, AsciiObjectPath, &ObjectHandle);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
@ -332,6 +333,7 @@ AcpiAmlObjectUpdateInteger (
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
goto Exit; goto Exit;
} }
ASSERT (DataType == EFI_ACPI_DATA_TYPE_OPCODE); ASSERT (DataType == EFI_ACPI_DATA_TYPE_OPCODE);
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);
@ -350,7 +352,7 @@ AcpiAmlObjectUpdateInteger (
ASSERT (DataType == EFI_ACPI_DATA_TYPE_OPCODE); ASSERT (DataType == EFI_ACPI_DATA_TYPE_OPCODE);
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);
if (Buffer[0] == AML_ZERO_OP || Buffer[0] == AML_ONE_OP) { if ((Buffer[0] == AML_ZERO_OP) || (Buffer[0] == AML_ONE_OP)) {
Status = AcpiSdtProtocol->SetOption (DataHandle, 0, (VOID *)&Value, sizeof (UINT8)); Status = AcpiSdtProtocol->SetOption (DataHandle, 0, (VOID *)&Value, sizeof (UINT8));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
} else { } else {
@ -358,26 +360,26 @@ AcpiAmlObjectUpdateInteger (
// Check the size of data object // Check the size of data object
// //
switch (Buffer[0]) { switch (Buffer[0]) {
case AML_BYTE_PREFIX: case AML_BYTE_PREFIX:
DataSize = sizeof (UINT8); DataSize = sizeof (UINT8);
break; break;
case AML_WORD_PREFIX: case AML_WORD_PREFIX:
DataSize = sizeof (UINT16); DataSize = sizeof (UINT16);
break; break;
case AML_DWORD_PREFIX: case AML_DWORD_PREFIX:
DataSize = sizeof (UINT32); DataSize = sizeof (UINT32);
break; break;
case AML_QWORD_PREFIX: case AML_QWORD_PREFIX:
DataSize = sizeof (UINT64); DataSize = sizeof (UINT64);
break; break;
default: default:
// The data type of the ACPI object is not an integer // The data type of the ACPI object is not an integer
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
goto Exit; goto Exit;
} }
Status = AcpiSdtProtocol->SetOption (DataHandle, 1, (VOID *)&Value, DataSize); Status = AcpiSdtProtocol->SetOption (DataHandle, 1, (VOID *)&Value, DataSize);