From ac0a286f4d747a4c6c603a7b225917293cbe1e9f Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Sun, 5 Dec 2021 14:54:09 -0800 Subject: OvmfPkg: Apply uncrustify changes REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the OvmfPkg package Cc: Andrew Fish Cc: Leif Lindholm Cc: Michael D Kinney Signed-off-by: Michael Kubacki Reviewed-by: Andrew Fish --- OvmfPkg/Bhyve/SmbiosPlatformDxe/Bhyve.c | 23 +++--- .../Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 91 +++++++++++----------- .../Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 2 - 3 files changed, 55 insertions(+), 61 deletions(-) (limited to 'OvmfPkg/Bhyve/SmbiosPlatformDxe') diff --git a/OvmfPkg/Bhyve/SmbiosPlatformDxe/Bhyve.c b/OvmfPkg/Bhyve/SmbiosPlatformDxe/Bhyve.c index 6ca976daa6..b70285bc2a 100644 --- a/OvmfPkg/Bhyve/SmbiosPlatformDxe/Bhyve.c +++ b/OvmfPkg/Bhyve/SmbiosPlatformDxe/Bhyve.c @@ -7,8 +7,8 @@ #include "SmbiosPlatformDxe.h" -#define BHYVE_SMBIOS_PHYSICAL_ADDRESS 0x000F0000 -#define BHYVE_SMBIOS_PHYSICAL_END 0x000FFFFF +#define BHYVE_SMBIOS_PHYSICAL_ADDRESS 0x000F0000 +#define BHYVE_SMBIOS_PHYSICAL_END 0x000FFFFF /** Locates the bhyve SMBIOS data if it exists @@ -24,18 +24,17 @@ GetBhyveSmbiosTables ( UINT8 *BhyveSmbiosPtr; SMBIOS_TABLE_ENTRY_POINT *BhyveSmbiosEntryPointStructure; - for (BhyveSmbiosPtr = (UINT8*)(UINTN) BHYVE_SMBIOS_PHYSICAL_ADDRESS; - BhyveSmbiosPtr < (UINT8*)(UINTN) BHYVE_SMBIOS_PHYSICAL_END; - BhyveSmbiosPtr += 0x10) { - - BhyveSmbiosEntryPointStructure = (SMBIOS_TABLE_ENTRY_POINT *) BhyveSmbiosPtr; - - if (!AsciiStrnCmp ((CHAR8 *) BhyveSmbiosEntryPointStructure->AnchorString, "_SM_", 4) && - !AsciiStrnCmp ((CHAR8 *) BhyveSmbiosEntryPointStructure->IntermediateAnchorString, "_DMI_", 5) && - IsEntryPointStructureValid (BhyveSmbiosEntryPointStructure)) { + for (BhyveSmbiosPtr = (UINT8 *)(UINTN)BHYVE_SMBIOS_PHYSICAL_ADDRESS; + BhyveSmbiosPtr < (UINT8 *)(UINTN)BHYVE_SMBIOS_PHYSICAL_END; + BhyveSmbiosPtr += 0x10) + { + BhyveSmbiosEntryPointStructure = (SMBIOS_TABLE_ENTRY_POINT *)BhyveSmbiosPtr; + if (!AsciiStrnCmp ((CHAR8 *)BhyveSmbiosEntryPointStructure->AnchorString, "_SM_", 4) && + !AsciiStrnCmp ((CHAR8 *)BhyveSmbiosEntryPointStructure->IntermediateAnchorString, "_DMI_", 5) && + IsEntryPointStructureValid (BhyveSmbiosEntryPointStructure)) + { return BhyveSmbiosEntryPointStructure; - } } diff --git a/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.c index 59f5d77a3b..ba21393f8e 100644 --- a/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -20,34 +20,34 @@ // #pragma pack(1) typedef struct { - SMBIOS_TABLE_TYPE0 Base; - UINT8 Strings[sizeof(TYPE0_STRINGS)]; + SMBIOS_TABLE_TYPE0 Base; + UINT8 Strings[sizeof (TYPE0_STRINGS)]; } OVMF_TYPE0; #pragma pack() -STATIC CONST OVMF_TYPE0 mOvmfDefaultType0 = { +STATIC CONST OVMF_TYPE0 mOvmfDefaultType0 = { { // SMBIOS_STRUCTURE Hdr { EFI_SMBIOS_TYPE_BIOS_INFORMATION, // UINT8 Type sizeof (SMBIOS_TABLE_TYPE0), // UINT8 Length }, - 1, // SMBIOS_TABLE_STRING Vendor - 2, // SMBIOS_TABLE_STRING BiosVersion - 0xE800,// UINT16 BiosSegment - 3, // SMBIOS_TABLE_STRING BiosReleaseDate - 0, // UINT8 BiosSize + 1, // SMBIOS_TABLE_STRING Vendor + 2, // SMBIOS_TABLE_STRING BiosVersion + 0xE800, // UINT16 BiosSegment + 3, // SMBIOS_TABLE_STRING BiosReleaseDate + 0, // UINT8 BiosSize { // MISC_BIOS_CHARACTERISTICS BiosCharacteristics - 0, // Reserved :2 - 0, // Unknown :1 - 1, // BiosCharacteristicsNotSupported :1 - // Remaining BiosCharacteristics bits left unset :60 + 0, // Reserved :2 + 0, // Unknown :1 + 1, // BiosCharacteristicsNotSupported :1 + // Remaining BiosCharacteristics bits left unset :60 }, { // BIOSCharacteristicsExtensionBytes[2] - 0, // BiosReserved - 0x1C // SystemReserved = VirtualMachineSupported | - // UefiSpecificationSupported | - // TargetContentDistributionEnabled + 0, // BiosReserved + 0x1C // SystemReserved = VirtualMachineSupported | + // UefiSpecificationSupported | + // TargetContentDistributionEnabled }, 0, // UINT8 SystemBiosMajorRelease 0, // UINT8 SystemBiosMinorRelease @@ -58,7 +58,6 @@ STATIC CONST OVMF_TYPE0 mOvmfDefaultType0 = { TYPE0_STRINGS }; - /** Validates the SMBIOS entry point structure @@ -73,17 +72,17 @@ IsEntryPointStructureValid ( IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure ) { - UINTN Index; - UINT8 Length; - UINT8 Checksum; - UINT8 *BytePtr; + UINTN Index; + UINT8 Length; + UINT8 Checksum; + UINT8 *BytePtr; - BytePtr = (UINT8*) EntryPointStructure; - Length = EntryPointStructure->EntryPointLength; + BytePtr = (UINT8 *)EntryPointStructure; + Length = EntryPointStructure->EntryPointLength; Checksum = 0; for (Index = 0; Index < Length; Index++) { - Checksum = Checksum + (UINT8) BytePtr[Index]; + Checksum = Checksum + (UINT8)BytePtr[Index]; } if (Checksum != 0) { @@ -93,7 +92,6 @@ IsEntryPointStructureValid ( } } - /** Get SMBIOS record length. @@ -102,7 +100,7 @@ IsEntryPointStructureValid ( **/ UINTN SmbiosTableLength ( - IN SMBIOS_STRUCTURE_POINTER SmbiosTable + IN SMBIOS_STRUCTURE_POINTER SmbiosTable ) { CHAR8 *AChar; @@ -114,14 +112,14 @@ SmbiosTableLength ( // Each structure shall be terminated by a double-null (SMBIOS spec.7.1) // while ((*AChar != 0) || (*(AChar + 1) != 0)) { - AChar ++; + AChar++; } + Length = ((UINTN)AChar - (UINTN)SmbiosTable.Raw + 2); return Length; } - /** Install all structures from the given SMBIOS structures block @@ -131,8 +129,8 @@ SmbiosTableLength ( **/ EFI_STATUS InstallAllStructures ( - IN EFI_SMBIOS_PROTOCOL *Smbios, - IN UINT8 *TableAddress + IN EFI_SMBIOS_PROTOCOL *Smbios, + IN UINT8 *TableAddress ) { EFI_STATUS Status; @@ -152,12 +150,12 @@ InstallAllStructures ( // Log the SMBIOS data for this structure // SmbiosHandle = SmbiosTable.Hdr->Handle; - Status = Smbios->Add ( - Smbios, - NULL, - &SmbiosHandle, - (EFI_SMBIOS_TABLE_HEADER*) SmbiosTable.Raw - ); + Status = Smbios->Add ( + Smbios, + NULL, + &SmbiosHandle, + (EFI_SMBIOS_TABLE_HEADER *)SmbiosTable.Raw + ); ASSERT_EFI_ERROR (Status); if (SmbiosTable.Hdr->Type == 0) { @@ -175,19 +173,18 @@ InstallAllStructures ( // Add OVMF default Type 0 (BIOS Information) table // SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED; - Status = Smbios->Add ( - Smbios, - NULL, - &SmbiosHandle, - (EFI_SMBIOS_TABLE_HEADER*) &mOvmfDefaultType0 - ); + Status = Smbios->Add ( + Smbios, + NULL, + &SmbiosHandle, + (EFI_SMBIOS_TABLE_HEADER *)&mOvmfDefaultType0 + ); ASSERT_EFI_ERROR (Status); } return EFI_SUCCESS; } - /** Installs SMBIOS information for OVMF @@ -201,8 +198,8 @@ InstallAllStructures ( EFI_STATUS EFIAPI SmbiosTablePublishEntry ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; @@ -216,7 +213,7 @@ SmbiosTablePublishEntry ( Status = gBS->LocateProtocol ( &gEfiSmbiosProtocolGuid, NULL, - (VOID**)&Smbios + (VOID **)&Smbios ); if (EFI_ERROR (Status)) { return Status; @@ -227,7 +224,7 @@ SmbiosTablePublishEntry ( // EntryPointStructure = GetBhyveSmbiosTables (); if (EntryPointStructure != NULL) { - SmbiosTables = (UINT8*)(UINTN)EntryPointStructure->TableAddress; + SmbiosTables = (UINT8 *)(UINTN)EntryPointStructure->TableAddress; } if (SmbiosTables != NULL) { diff --git a/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h index 12d7be7b24..147370533d 100644 --- a/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -21,7 +21,6 @@ #include #include - /** Locates the bhyve SMBIOS data if it exists @@ -33,7 +32,6 @@ GetBhyveSmbiosTables ( VOID ); - /** Validates the SMBIOS entry point structure -- cgit v1.2.3