From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.96441.1673327190868461527 for ; Mon, 09 Jan 2023 21:06:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SZt1l79H; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673327189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=agXhKrI7Es0k5tUxTCxVmgM6eBc1vO5x2AhPn27QDqQ=; b=SZt1l79H5k/9I5fjb3KskMwUkGNnSr3bctTCPkEiiexzL1Ridl9TBB9cMq6XlUpJgJznVM WdxK1y5DZKnAIp4h1SS+VudRzloNLSOF9FY3hDi9P0mGppib1mN45ti3kwXKk3JRewm90A Q4QVakfwciE4DuA5TSp9nDr9aLiXERI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-175-6diUe2GVNlSlJ7oQRLe1Dw-1; Tue, 10 Jan 2023 00:06:25 -0500 X-MC-Unique: 6diUe2GVNlSlJ7oQRLe1Dw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6E1172999B2D; Tue, 10 Jan 2023 05:06:23 +0000 (UTC) Received: from [10.39.192.22] (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E7B340C1141; Tue, 10 Jan 2023 05:06:22 +0000 (UTC) Message-ID: Date: Tue, 10 Jan 2023 06:06:21 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH V2 3/6] OvmfPkg/AcpiPlatformDxe: Use local variable in QemuFwCfgAcpi.c To: devel@edk2.groups.io, min.m.xu@intel.com Cc: Erdem Aktas , James Bottomley , Jiewen Yao , Gerd Hoffmann , Tom Lendacky References: <20230109135917.1752-1-min.m.xu@intel.com> <20230109135917.1752-4-min.m.xu@intel.com> From: "Laszlo Ersek" In-Reply-To: <20230109135917.1752-4-min.m.xu@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/9/23 14:59, Min Xu wrote: > 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 Reviewed-by: Laszlo Ersek