From f81273f7fbb3defbef43313ada8397bbc202a1d0 Mon Sep 17 00:00:00 2001 From: Min M Xu Date: Wed, 11 Jan 2023 09:22:31 +0800 Subject: [PATCH] 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 Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Cc: Sebastien Boeuf Reported-by: Laszlo Ersek Signed-off-by: Min Xu Message-Id: <20230111012235.189-3-min.m.xu@intel.com> Reviewed-by: Sebastien Boeuf --- OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c index ad39e42534..8f90ea2399 100644 --- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c @@ -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