summaryrefslogtreecommitdiff
path: root/EmbeddedPkg
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2022-09-02 20:52:36 -0400
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-10-03 18:22:03 +0000
commit51e059953696f1b41e7f65426e342badc2e6acaf (patch)
tree24293dbff974dc45db611808167ce7ec4cf912b2 /EmbeddedPkg
parentf01d3ee12caf5eae4ece4fc5b85c57c56fb06cc0 (diff)
downloadedk2-51e059953696f1b41e7f65426e342badc2e6acaf.zip
edk2-51e059953696f1b41e7f65426e342badc2e6acaf.tar.gz
edk2-51e059953696f1b41e7f65426e342badc2e6acaf.tar.bz2
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>
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r--EmbeddedPkg/Include/Library/AcpiLib.h22
-rw-r--r--EmbeddedPkg/Library/AcpiLib/AcpiLib.c98
2 files changed, 61 insertions, 59 deletions
diff --git a/EmbeddedPkg/Include/Library/AcpiLib.h b/EmbeddedPkg/Include/Library/AcpiLib.h
index 9dbacd8..29137a4 100644
--- a/EmbeddedPkg/Include/Library/AcpiLib.h
+++ b/EmbeddedPkg/Include/Library/AcpiLib.h
@@ -144,8 +144,8 @@ LocateAndInstallAcpiFromFv (
EFI_STATUS
EFIAPI
AcpiUpdateChecksum (
- IN OUT UINT8 *Buffer,
- IN UINTN Size
+ IN OUT UINT8 *Buffer,
+ IN UINTN Size
);
/**
@@ -168,11 +168,11 @@ AcpiUpdateChecksum (
EFI_STATUS
EFIAPI
AcpiLocateTableBySignature (
- IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
- IN UINT32 TableSignature,
- IN OUT UINTN *Index,
- OUT EFI_ACPI_DESCRIPTION_HEADER **Table,
- OUT UINTN *TableKey
+ IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
+ IN UINT32 TableSignature,
+ IN OUT UINTN *Index,
+ OUT EFI_ACPI_DESCRIPTION_HEADER **Table,
+ OUT UINTN *TableKey
);
/**
@@ -193,10 +193,10 @@ AcpiLocateTableBySignature (
EFI_STATUS
EFIAPI
AcpiAmlObjectUpdateInteger (
- IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
- IN EFI_ACPI_HANDLE TableHandle,
- IN CHAR8 *AsciiObjectPath,
- IN UINTN Value
+ IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
+ IN EFI_ACPI_HANDLE TableHandle,
+ IN CHAR8 *AsciiObjectPath,
+ IN UINTN Value
);
#endif // __ACPI_LIB_H__
diff --git a/EmbeddedPkg/Library/AcpiLib/AcpiLib.c b/EmbeddedPkg/Library/AcpiLib/AcpiLib.c
index ea2ad63..cb593a7 100644
--- a/EmbeddedPkg/Library/AcpiLib/AcpiLib.c
+++ b/EmbeddedPkg/Library/AcpiLib/AcpiLib.c
@@ -192,13 +192,13 @@ LocateAndInstallAcpiFromFv (
EFI_STATUS
EFIAPI
AcpiUpdateChecksum (
- IN OUT UINT8 *Buffer,
- IN UINTN Size
+ IN OUT UINT8 *Buffer,
+ IN UINTN Size
)
{
- UINTN ChecksumOffset;
+ UINTN ChecksumOffset;
- if (Buffer == NULL || Size == 0) {
+ if ((Buffer == NULL) || (Size == 0)) {
return EFI_INVALID_PARAMETER;
}
@@ -237,11 +237,11 @@ AcpiUpdateChecksum (
EFI_STATUS
EFIAPI
AcpiLocateTableBySignature (
- IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
- IN UINT32 TableSignature,
- IN OUT UINTN *Index,
- OUT EFI_ACPI_DESCRIPTION_HEADER **Table,
- OUT UINTN *TableKey
+ IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
+ IN UINT32 TableSignature,
+ IN OUT UINTN *Index,
+ OUT EFI_ACPI_DESCRIPTION_HEADER **Table,
+ OUT UINTN *TableKey
)
{
EFI_STATUS Status;
@@ -249,9 +249,10 @@ AcpiLocateTableBySignature (
EFI_ACPI_TABLE_VERSION TableVersion;
UINTN TableIndex;
- if (AcpiSdtProtocol == NULL
- || Table == NULL
- || TableKey == NULL) {
+ if ( (AcpiSdtProtocol == NULL)
+ || (Table == NULL)
+ || (TableKey == NULL))
+ {
return EFI_INVALID_PARAMETER;
}
@@ -261,7 +262,7 @@ AcpiLocateTableBySignature (
// Search for ACPI Table with matching signature
//
TableVersion = 0;
- TableIndex = *Index;
+ TableIndex = *Index;
while (!EFI_ERROR (Status)) {
Status = AcpiSdtProtocol->GetAcpiTable (
TableIndex,
@@ -301,26 +302,26 @@ AcpiLocateTableBySignature (
EFI_STATUS
EFIAPI
AcpiAmlObjectUpdateInteger (
- IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
- IN EFI_ACPI_HANDLE TableHandle,
- IN CHAR8 *AsciiObjectPath,
- IN UINTN Value
+ IN EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol,
+ IN EFI_ACPI_HANDLE TableHandle,
+ IN CHAR8 *AsciiObjectPath,
+ IN UINTN Value
)
{
- EFI_STATUS Status;
- EFI_ACPI_HANDLE ObjectHandle;
- EFI_ACPI_HANDLE DataHandle;
- EFI_ACPI_DATA_TYPE DataType;
- UINT8 *Buffer;
- UINTN BufferSize;
- UINTN DataSize;
-
- if (AcpiSdtProtocol == NULL || AsciiObjectPath == NULL) {
+ EFI_STATUS Status;
+ EFI_ACPI_HANDLE ObjectHandle;
+ EFI_ACPI_HANDLE DataHandle;
+ EFI_ACPI_DATA_TYPE DataType;
+ UINT8 *Buffer;
+ UINTN BufferSize;
+ UINTN DataSize;
+
+ if ((AcpiSdtProtocol == NULL) || (AsciiObjectPath == NULL)) {
return EFI_INVALID_PARAMETER;
}
ObjectHandle = NULL;
- DataHandle = NULL;
+ DataHandle = NULL;
Status = AcpiSdtProtocol->FindPath (TableHandle, AsciiObjectPath, &ObjectHandle);
if (EFI_ERROR (Status)) {
@@ -332,6 +333,7 @@ AcpiAmlObjectUpdateInteger (
Status = EFI_NOT_FOUND;
goto Exit;
}
+
ASSERT (DataType == EFI_ACPI_DATA_TYPE_OPCODE);
ASSERT (Buffer != NULL);
@@ -350,7 +352,7 @@ AcpiAmlObjectUpdateInteger (
ASSERT (DataType == EFI_ACPI_DATA_TYPE_OPCODE);
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));
ASSERT_EFI_ERROR (Status);
} else {
@@ -358,26 +360,26 @@ AcpiAmlObjectUpdateInteger (
// Check the size of data object
//
switch (Buffer[0]) {
- case AML_BYTE_PREFIX:
- DataSize = sizeof (UINT8);
- break;
-
- case AML_WORD_PREFIX:
- DataSize = sizeof (UINT16);
- break;
-
- case AML_DWORD_PREFIX:
- DataSize = sizeof (UINT32);
- break;
-
- case AML_QWORD_PREFIX:
- DataSize = sizeof (UINT64);
- break;
-
- default:
- // The data type of the ACPI object is not an integer
- Status = EFI_INVALID_PARAMETER;
- goto Exit;
+ case AML_BYTE_PREFIX:
+ DataSize = sizeof (UINT8);
+ break;
+
+ case AML_WORD_PREFIX:
+ DataSize = sizeof (UINT16);
+ break;
+
+ case AML_DWORD_PREFIX:
+ DataSize = sizeof (UINT32);
+ break;
+
+ case AML_QWORD_PREFIX:
+ DataSize = sizeof (UINT64);
+ break;
+
+ default:
+ // The data type of the ACPI object is not an integer
+ Status = EFI_INVALID_PARAMETER;
+ goto Exit;
}
Status = AcpiSdtProtocol->SetOption (DataHandle, 1, (VOID *)&Value, DataSize);