OvmfPkg/AcpiPlatformDxe: Use local variable in CloudHvAcpi.c

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4237

The handle of mChAcpiHandle is not needed for anything, beyond the
scope of the InstallCloudHvTablesTdx (). A local variable (ChAcpiHandle)
suffices for storing the handle.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Sebastien Boeuf <sebastien.boeuf@intel.com>
Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Message-Id: <20230111012235.189-3-min.m.xu@intel.com>
Reviewed-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Min M Xu 2023-01-11 09:22:31 +08:00 committed by mergify[bot]
parent 43b3ca6b7f
commit f81273f7fb
1 changed files with 3 additions and 3 deletions

View File

@ -20,8 +20,6 @@
#include "AcpiPlatform.h"
EFI_HANDLE mChAcpiHandle = NULL;
EFI_STATUS
EFIAPI
InstallCloudHvTablesTdx (
@ -30,6 +28,7 @@ InstallCloudHvTablesTdx (
{
EFI_STATUS Status;
UINTN TableHandle;
EFI_HANDLE ChAcpiHandle;
EFI_PEI_HOB_POINTERS Hob;
EFI_ACPI_DESCRIPTION_HEADER *CurrentTable;
@ -89,8 +88,9 @@ InstallCloudHvTablesTdx (
// Install a protocol to notify that the ACPI table provided by CH is
// ready.
//
ChAcpiHandle = NULL;
gBS->InstallProtocolInterface (
&mChAcpiHandle,
&ChAcpiHandle,
&gQemuAcpiTableNotifyProtocolGuid,
EFI_NATIVE_INTERFACE,
NULL