]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/AcpiPlatformDxe: Use local variable in CloudHvAcpi.c
authorMin M Xu <min.m.xu@intel.com>
Wed, 11 Jan 2023 01:22:31 +0000 (09:22 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 15 Jan 2023 10:26:15 +0000 (10:26 +0000)
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>
OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c

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