]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: stop abusing EFI_EVENT for protocol notify registration
authorLaszlo Ersek <lersek@redhat.com>
Fri, 6 Sep 2019 22:58:19 +0000 (00:58 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Wed, 9 Oct 2019 07:40:09 +0000 (09:40 +0200)
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 for
nothing else.

This change is a no-op in practice; it's a semantic improvement.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c
MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c

index ae8f117905cd5a0f3ac14a6bad32773b18b8ed90..de38ea028af154eaa88e2eb8262d44450f3bbf6c 100644 (file)
@@ -47,7 +47,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 \r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include "FaultTolerantWrite.h"\r
-EFI_EVENT                                 mFvbRegistration = NULL;\r
+VOID                                      *mFvbRegistration = NULL;\r
 \r
 \r
 /**\r
index e8e935a85b5beb82973be3658f875d7cf14edb25..9612b394865b8b9301b7537daa7822d912ce2b2e 100644 (file)
@@ -56,7 +56,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include "FaultTolerantWriteSmmCommon.h"\r
 #include <Protocol/MmEndOfDxe.h>\r
 \r
-EFI_EVENT                                 mFvbRegistration = NULL;\r
+VOID                                      *mFvbRegistration = NULL;\r
 EFI_FTW_DEVICE                            *mFtwDevice      = NULL;\r
 \r
 ///\r
index 4af2da05e1453362a81a2adfe9315634e4a689e1..43fa6ce12875ef2440c7b903a5dae4b2a26e51d8 100644 (file)
@@ -36,7 +36,7 @@ typedef struct {
 #define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_THIS(a) CR (a, LOAD_FILE_ON_FV2_PRIVATE_DATA, LoadFile, LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE)\r
 #define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_LINK(a) CR (a, LOAD_FILE_ON_FV2_PRIVATE_DATA, Link, LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE)\r
 \r
-EFI_EVENT  mFvRegistration;\r
+VOID       *mFvRegistration;\r
 LIST_ENTRY mPrivateDataList;\r
 \r
 /**\r
index 3d232bb36cb467cd2d2bc7f27397ed77a29f4a75..7d2b6c8e1fad1c55d172994d421a6cbb5d17a5e5 100644 (file)
@@ -13,7 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 \r
 EFI_HANDLE                          mHandle                    = NULL;\r
 EFI_EVENT                           mVirtualAddressChangeEvent = NULL;\r
-EFI_EVENT                           mFtwRegistration           = NULL;\r
+VOID                                *mFtwRegistration          = NULL;\r
 VOID                                ***mVarCheckAddressPointer = NULL;\r
 UINTN                               mVarCheckAddressPointerCount = 0;\r
 EDKII_VARIABLE_LOCK_PROTOCOL        mVariableLock              = { VariableLockRequestToLock };\r