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:05 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=WaW0Fh5N; 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=1673272805; x=1704808805; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3QYNKfRQ+mSGULlu5LgchZJYuD0eBBxo+K2KhsZEMQA=; b=WaW0Fh5NlnZ3SPzgTg4Kb+MAmd4z/L0mCRQndrTKTxo2kCpeKKKcMeiy tCcIYOweuk1bqlfsBosxP3+QtZ94WTnk+DLZlgYEIrb7N38uxAVAtpF4A bR2ITFDBjXfX7LQbsfkwCDF/Ls2H82e9oM+u6h/D4qcWOMD9daMa0hxAZ C8KUOLBA7LjqolykPIP9JcEOozdrEtb5klc+FQyR2rbXBYeyofRWmkXt/ 19vri+QLzr7Llo4l6zp4WQrHQaBvr9WwSQnL00FTvWjF4xuRVCiUx4SKf avfp8vkNW0bV3uDE+lfFP3RXJDfUDlxAPk26wqBfZqTd7oU1L0/6mS5DK g==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="306394421" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="306394421" 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:39 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="634217681" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="634217681" 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:37 -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 Subject: [PATCH V2 3/6] OvmfPkg/AcpiPlatformDxe: Use local variable in QemuFwCfgAcpi.c Date: Mon, 9 Jan 2023 21:59:14 +0800 Message-Id: <20230109135917.1752-4-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 mQemuAcpiHandle is not needed for anything, beyond the scope of the InstallQemuFwCfgTables(). So a local variable will suffice for storing the handle. Cc: Laszlo Ersek Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Reported-by: Laszlo Ersek Signed-off-by: Min Xu --- OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c index 1a3852904df9..693cb8c8a83e 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c @@ -20,7 +20,6 @@ #include // gBS #include "AcpiPlatform.h" -EFI_HANDLE mQemuAcpiHandle = NULL; // // The user structure for the ordered collection that will track the fw_cfg @@ -1101,6 +1100,9 @@ InstallQemuFwCfgTables ( ORDERED_COLLECTION_ENTRY *TrackerEntry, *TrackerEntry2; ORDERED_COLLECTION *SeenPointers; ORDERED_COLLECTION_ENTRY *SeenPointerEntry, *SeenPointerEntry2; + EFI_HANDLE QemuAcpiHandle; + + QemuAcpiHandle = NULL; Status = QemuFwCfgFindFile ("etc/table-loader", &FwCfgItem, &FwCfgSize); if (EFI_ERROR (Status)) { @@ -1279,7 +1281,7 @@ UninstallAcpiTables: // ready. // gBS->InstallProtocolInterface ( - &mQemuAcpiHandle, + &QemuAcpiHandle, &gQemuAcpiTableNotifyProtocolGuid, EFI_NATIVE_INTERFACE, NULL -- 2.29.2.windows.2