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.133.124]) by mx.groups.io with SMTP id smtpd.web11.29290.1673455782369902282 for ; Wed, 11 Jan 2023 08:49:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QADklYD+; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673455781; 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=PaTf1Rz0Rl+hwEw2mfpcPKCXr8MC6ea+5SmNdnIcuYc=; b=QADklYD+OrLH/m8CC0+P1PQI+tTMIJjV7atJI2qjqkZ8C8ilTdI3oHi/RQBvbZ0pkFwxgq X0E6dPnc8C4dSnv94o9vNMVZLLsY7cUDJMn71GQWPzS5AlYJcgAA9JVbMO7mP6wpjLq5FW DyMhfbTsOIFI0gocNN1EJJQ6sxag6YM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-xl3dstevNdKgW3cjKixVQw-1; Wed, 11 Jan 2023 11:49:38 -0500 X-MC-Unique: xl3dstevNdKgW3cjKixVQw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A3339181E3F2; Wed, 11 Jan 2023 16:49:37 +0000 (UTC) Received: from [10.39.192.40] (unknown [10.39.192.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6899A492C14; Wed, 11 Jan 2023 16:49:36 +0000 (UTC) Message-ID: <51513684-9010-5bd4-a5e3-20f32c5a9635@redhat.com> Date: Wed, 11 Jan 2023 17:49:34 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH V3 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: <20230111012235.189-1-min.m.xu@intel.com> <20230111012235.189-4-min.m.xu@intel.com> From: "Laszlo Ersek" In-Reply-To: <20230111012235.189-4-min.m.xu@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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/11/23 02:22, 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 > Reviewed-by: Laszlo Ersek > Signed-off-by: Min Xu > --- > OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c > index 1a3852904df9..9711335c6cac 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,7 @@ InstallQemuFwCfgTables ( > ORDERED_COLLECTION_ENTRY *TrackerEntry, *TrackerEntry2; > ORDERED_COLLECTION *SeenPointers; > ORDERED_COLLECTION_ENTRY *SeenPointerEntry, *SeenPointerEntry2; > + EFI_HANDLE QemuAcpiHandle; > > Status = QemuFwCfgFindFile ("etc/table-loader", &FwCfgItem, &FwCfgSize); > if (EFI_ERROR (Status)) { > @@ -1278,8 +1278,9 @@ UninstallAcpiTables: > // Install a protocol to notify that the ACPI table provided by Qemu is > // ready. > // > + QemuAcpiHandle = NULL; > gBS->InstallProtocolInterface ( > - &mQemuAcpiHandle, > + &QemuAcpiHandle, > &gQemuAcpiTableNotifyProtocolGuid, > EFI_NATIVE_INTERFACE, > NULL The update looks good, my R-b stands. Thanks! Laszlo