public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Min Xu" <min.m.xu@intel.com>
To: devel@edk2.groups.io
Cc: Min M Xu <min.m.xu@intel.com>, Laszlo Ersek <lersek@redhat.com>,
	Erdem Aktas <erdemaktas@google.com>,
	James Bottomley <jejb@linux.ibm.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Sebastien Boeuf <sebastien.boeuf@intel.com>
Subject: [PATCH V2 2/6] OvmfPkg/AcpiPlatformDxe: Use local variable in CloudHvAcpi.c
Date: Mon,  9 Jan 2023 21:59:13 +0800	[thread overview]
Message-ID: <20230109135917.1752-3-min.m.xu@intel.com> (raw)
In-Reply-To: <20230109135917.1752-1-min.m.xu@intel.com>

From: Min M Xu <min.m.xu@intel.com>

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>
---
 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
index ad39e4253478..d849a59526b5 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,13 +28,15 @@ InstallCloudHvTablesTdx (
 {
   EFI_STATUS  Status;
   UINTN       TableHandle;
+  EFI_HANDLE  ChAcpiHandle;
 
   EFI_PEI_HOB_POINTERS         Hob;
   EFI_ACPI_DESCRIPTION_HEADER  *CurrentTable;
   EFI_ACPI_DESCRIPTION_HEADER  *DsdtTable;
 
-  DsdtTable   = NULL;
-  TableHandle = 0;
+  DsdtTable    = NULL;
+  TableHandle  = 0;
+  ChAcpiHandle = NULL;
 
   Hob.Guid = (EFI_HOB_GUID_TYPE *)GetFirstGuidHob (&gUefiOvmfPkgTdxAcpiHobGuid);
 
@@ -90,7 +90,7 @@ InstallCloudHvTablesTdx (
   // ready.
   //
   gBS->InstallProtocolInterface (
-         &mChAcpiHandle,
+         &ChAcpiHandle,
          &gQemuAcpiTableNotifyProtocolGuid,
          EFI_NATIVE_INTERFACE,
          NULL
-- 
2.29.2.windows.2


  parent reply	other threads:[~2023-01-09 14:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 13:59 [PATCH V2 0/6] Refactor installation of gQemuAcpiTableNotifyProtocol Min Xu
2023-01-09 13:59 ` [PATCH V2 1/6] OvmfPkg/AcpiPlatformDxe: Remove QEMU_ACPI_TABLE_NOTIFY_PROTOCOL Min Xu
2023-01-10  5:05   ` [edk2-devel] " Laszlo Ersek
2023-01-09 13:59 ` Min Xu [this message]
2023-01-09 13:59 ` [PATCH V2 3/6] OvmfPkg/AcpiPlatformDxe: Use local variable in QemuFwCfgAcpi.c Min Xu
2023-01-10  5:06   ` [edk2-devel] " Laszlo Ersek
2023-01-09 13:59 ` [PATCH V2 4/6] OvmfPkg/AcpiPlatformDxe: Add log to show the installed tables Min Xu
2023-01-10  5:10   ` [edk2-devel] " Laszlo Ersek
2023-01-09 13:59 ` [PATCH V2 5/6] OvmfPkg/AcpiPlatformDxe: Refactor QemuAcpiTableNotifyProtocol Min Xu
2023-01-10  5:50   ` [edk2-devel] " Laszlo Ersek
2023-01-10  6:23     ` Min Xu
2023-01-09 13:59 ` [PATCH V2 6/6] OvmfPkg/AcpiPlatformDxe: Return error if installing NotifyProtocol failed Min Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230109135917.1752-3-min.m.xu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox