From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Tue, 17 Sep 2019 12:50:04 -0700 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 052F418CB8E1; Tue, 17 Sep 2019 19:50:04 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-37.rdu2.redhat.com [10.10.120.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4FD68600C4; Tue, 17 Sep 2019 19:50:02 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Hao A Wu , Jian J Wang , Liming Gao , Ray Ni , Zhichao Gao Subject: [PATCH 09/35] MdeModulePkg: stop abusing EFI_EVENT for protocol notify registration Date: Tue, 17 Sep 2019 21:49:09 +0200 Message-Id: <20190917194935.24322-10-lersek@redhat.com> In-Reply-To: <20190917194935.24322-1-lersek@redhat.com> References: <20190917194935.24322-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Tue, 17 Sep 2019 19:50:04 +0000 (UTC) Content-Transfer-Encoding: quoted-printable EfiCreateProtocolNotifyEvent() takes a (VOID**) for "Registration", similarly to gBS->RegisterProtocolNotify(). We should pass the address of an actual pointer-to-VOID, and not the address of an EFI_EVENT. EFI_EVENT just happens to be specified as (VOID*), and has nothing to do with the registration. The same applies to gMmst->MmRegisterProtocolNotify(). "mFtwRegistration", "mFvRegistration", and "mFvbRegistration" are used fo= r nothing else. This change is a no-op in practice; it's a semantic improvement. Cc: Hao A Wu Cc: Jian J Wang Cc: Liming Gao Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Laszlo Ersek --- Notes: lightly tested, as these modules (except LoadFileOnFv2) are part of t= he ArmVirt and/or OVMF platforms MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c | 2= +- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c | 2= +- MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c | 2= +- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c | 2= +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWr= iteDxe.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrit= eDxe.c index ae8f117905cd..de38ea028af1 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.= c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.= c @@ -47,7 +47,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 #include #include "FaultTolerantWrite.h" -EFI_EVENT mFvbRegistration =3D NULL; +VOID *mFvbRegistration =3D NULL; =20 =20 /** diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWr= iteSmm.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrit= eSmm.c index e8e935a85b5b..9612b394865b 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.= c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.= c @@ -56,7 +56,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include "FaultTolerantWriteSmmCommon.h" #include =20 -EFI_EVENT mFvbRegistration =3D NULL; +VOID *mFvbRegistration =3D NULL; EFI_FTW_DEVICE *mFtwDevice =3D NULL; =20 /// diff --git a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c b/MdeMo= dulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c index 4af2da05e145..43fa6ce12875 100644 --- a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c +++ b/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c @@ -36,7 +36,7 @@ typedef struct { #define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_THIS(a) CR (a, LOAD_FILE_ON_F= V2_PRIVATE_DATA, LoadFile, LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE) #define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_LINK(a) CR (a, LOAD_FILE_ON_F= V2_PRIVATE_DATA, Link, LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE) =20 -EFI_EVENT mFvRegistration; +VOID *mFvRegistration; LIST_ENTRY mPrivateDataList; =20 /** diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c b/M= deModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c index 3d232bb36cb4..7d2b6c8e1fad 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c @@ -13,7 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 EFI_HANDLE mHandle =3D NULL; EFI_EVENT mVirtualAddressChangeEvent =3D NULL; -EFI_EVENT mFtwRegistration =3D NULL; +VOID *mFtwRegistration =3D NULL; VOID ***mVarCheckAddressPointer =3D NULL; UINTN mVarCheckAddressPointerCount =3D 0; EDKII_VARIABLE_LOCK_PROTOCOL mVariableLock =3D { Var= iableLockRequestToLock }; --=20 2.19.1.3.g30247aa5d201