From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.72183.1673272804664614480 for ; Mon, 09 Jan 2023 06:00:04 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=CahsxZIB; spf=pass (domain: intel.com, ip: 134.134.136.126, 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=1673272804; x=1704808804; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X6yXl/YWhNWrQwdvc5VQx/asLWZru5DY60ZUiADD/64=; b=CahsxZIBsUmzkHX2uziLL8aM7He4BIcztZ2n8JuvgZhjUaGcrpMWM/ab /E6oCsucgnxadImd5N0pAGVJtcfaFtQz8NGZEysx2+1ZKa0xNej9JaloC do5oQtwjoHRVG6OMJNm/b/NFxlVc301S0pYkNd5IhvXngvvMOVSOj8O2t wPhFVZsqCkTBtlu4qBqXSd9xm7KVRnHfNwIJrjflboHoIg4zblbS8qmQP arTlyGG0JOi6a7d8QqFzi21V5R10dls+ZrZt3zF6X+63dPKK3N6qn5Ke3 SEltF14QrFi8MGiFNwtruTFBgNf7vFyRrZIqzXpoBR0MyRsOpwOJ3fUZP w==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="306394414" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="306394414" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 05:59:37 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="634217677" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="634217677" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.30.4]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 05:59:34 -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 V2 2/6] OvmfPkg/AcpiPlatformDxe: Use local variable in CloudHvAcpi.c Date: Mon, 9 Jan 2023 21:59:13 +0800 Message-Id: <20230109135917.1752-3-min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: <20230109135917.1752-1-min.m.xu@intel.com> References: <20230109135917.1752-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 | 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