The InstallAcpiTable() helper function buys us nothing. Reduce code complexity by removing the function.
This patch is best viewed with "git show -b". Cc: Anthony Perard <anthony.per...@citrix.com> Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org> Cc: Jordan Justen <jordan.l.jus...@intel.com> Cc: Julien Grall <jul...@xen.org> Cc: Philippe Mathieu-Daudé <phi...@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <ler...@redhat.com> --- OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h | 9 --- OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c | 30 ++-------- OvmfPkg/XenAcpiPlatformDxe/Xen.c | 60 ++++++++++---------- 3 files changed, 36 insertions(+), 63 deletions(-) diff --git a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h index 2959ff0be6cf..47d9769ed12b 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h @@ -9,21 +9,12 @@ #ifndef ACPI_PLATFORM_H_ #define ACPI_PLATFORM_H_ #include <Protocol/AcpiTable.h> // EFI_ACPI_TABLE_PROTOCOL -EFI_STATUS -EFIAPI -InstallAcpiTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ); - EFI_STATUS EFIAPI InstallXenTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol ); diff --git a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c index 66dcf885859e..daf2bf3f458a 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c @@ -11,30 +11,12 @@ #include <Library/UefiBootServicesTableLib.h> // gBS #include <Library/XenPlatformLib.h> // XenDetected() #include <Protocol/FirmwareVolume2.h> // gEfiFirmwareVolume2Protocol... #include "AcpiPlatform.h" -EFI_STATUS -EFIAPI -InstallAcpiTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ) -{ - return AcpiProtocol->InstallAcpiTable ( - AcpiProtocol, - AcpiTableBuffer, - AcpiTableBufferSize, - TableKey - ); -} - - /** Locate the first instance of a protocol. If the protocol requested is an FV protocol, then it will return the first FV that contains the ACPI table storage file. @param Instance Return pointer to the first instance of the protocol @@ -197,18 +179,18 @@ InstallOvmfFvTables ( TableSize = ((EFI_ACPI_DESCRIPTION_HEADER *) CurrentTable)->Length; ASSERT (Size >= TableSize); // // Install ACPI table // - Status = InstallAcpiTable ( - AcpiTable, - CurrentTable, - TableSize, - &TableHandle - ); + Status = AcpiTable->InstallAcpiTable ( + AcpiTable, + CurrentTable, + TableSize, + &TableHandle + ); // // Free memory allocated by ReadSection // gBS->FreePool (CurrentTable); diff --git a/OvmfPkg/XenAcpiPlatformDxe/Xen.c b/OvmfPkg/XenAcpiPlatformDxe/Xen.c index e8395db548d9..151376176f7d 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/Xen.c +++ b/OvmfPkg/XenAcpiPlatformDxe/Xen.c @@ -182,18 +182,18 @@ InstallXenTables ( CurrentTablePointer = (UINTN) *(UINT64 *)CurrentTableEntry; CurrentTable = (EFI_ACPI_DESCRIPTION_HEADER *) CurrentTablePointer; // // Install the XSDT tables // - Status = InstallAcpiTable ( - AcpiProtocol, - CurrentTable, - CurrentTable->Length, - &TableHandle - ); + Status = AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + CurrentTable, + CurrentTable->Length, + &TableHandle + ); if (EFI_ERROR (Status)) { return Status; } // @@ -232,18 +232,18 @@ InstallXenTables ( CurrentTablePointer = *(UINT32 *)CurrentTableEntry; CurrentTable = (EFI_ACPI_DESCRIPTION_HEADER *) CurrentTablePointer; // // Install the RSDT tables // - Status = InstallAcpiTable ( - AcpiProtocol, - CurrentTable, - CurrentTable->Length, - &TableHandle - ); + Status = AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + CurrentTable, + CurrentTable->Length, + &TableHandle + ); if (EFI_ERROR (Status)) { return Status; } // @@ -263,32 +263,32 @@ InstallXenTables ( // Install the FACS table. // if (Fadt2Table) { // // FACS 2.0 // - Status = InstallAcpiTable ( - AcpiProtocol, - Facs2Table, - Facs2Table->Length, - &TableHandle - ); + Status = AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + Facs2Table, + Facs2Table->Length, + &TableHandle + ); if (EFI_ERROR (Status)) { return Status; } } else if (Fadt1Table) { // // FACS 1.0 // - Status = InstallAcpiTable ( - AcpiProtocol, - Facs1Table, - Facs1Table->Length, - &TableHandle - ); + Status = AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + Facs1Table, + Facs1Table->Length, + &TableHandle + ); if (EFI_ERROR (Status)) { return Status; } } // @@ -298,18 +298,18 @@ InstallXenTables ( if (DsdtTable == NULL) { DEBUG ((DEBUG_ERROR, "%a: no DSDT found\n", __FUNCTION__)); ASSERT (FALSE); CpuDeadLoop (); } - Status = InstallAcpiTable ( - AcpiProtocol, - DsdtTable, - DsdtTable->Length, - &TableHandle - ); + Status = AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + DsdtTable, + DsdtTable->Length, + &TableHandle + ); if (EFI_ERROR (Status)) { return Status; } return EFI_SUCCESS; } -- 2.19.1.3.g30247aa5d201 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75684): https://edk2.groups.io/g/devel/message/75684 Mute This Topic: https://groups.io/mt/83110592/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-