From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.12263.1673400243431217605 for ; Tue, 10 Jan 2023 17:24:03 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=WOBt0KO8; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673400243; x=1704936243; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZfXUyIks6/PAvhG4ISX+aMaWx5RS46MtFaDMwK+crII=; b=WOBt0KO8K8nEB8Thb7+7C3Ygt0feNwB0sn3D4K4Tc0A3piW2+1l1XxIr 0tJ9hlt/nBh9ORbVHizy3Gaz+A0F7OS/ZO+7vTtHKhJm3WHtfdh5X40a6 MYGiOdptJRwNyOVTIge/y+6lY9yJg8FjwxlTYoQP3P+vuU2Tnz8QZsr23 vedu8nhjq2y/uX7bQgBfyQhl1fF9z8yh55sUKyYIp/EZgUEMcmkfasw3l v0DoSXjMui5fR2IgYuk2xwJ5/11hKeKrXKywW4XLBvezon2j23ufCUVZD GaWNHVwSJeqazPPJ0HOvByF2iMJOmMEZJM8vGnMc562TZ/JA606YX1ZP5 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="387764360" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="387764360" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 17:24:02 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="659192775" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="659192775" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.213.42.137]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 17:23:52 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Laszlo Ersek , Erdem Aktas , James Bottomley , Jiewen Yao , Gerd Hoffmann , Tom Lendacky , Sebastien Boeuf Subject: [PATCH V3 2/6] OvmfPkg/AcpiPlatformDxe: Use local variable in CloudHvAcpi.c Date: Wed, 11 Jan 2023 09:22:31 +0800 Message-Id: <20230111012235.189-3-min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: <20230111012235.189-1-min.m.xu@intel.com> References: <20230111012235.189-1-min.m.xu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Min M Xu 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 --- 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 ad39e4253478..8f90ea23996d 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 -- 2.29.2.windows.2