On 09/25/19 18:02, Philippe Mathieu-Daudé wrote:
> On 9/17/19 9:49 PM, Laszlo Ersek wrote:
>> 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...@intel.com>
>> Cc: Jian J Wang <jian.j.w...@intel.com>
>> Cc: Liming Gao <liming....@intel.com>
>> Cc: Ray Ni <ray...@intel.com>
>> Cc: Zhichao Gao <zhichao....@intel.com>
>> Signed-off-by: Laszlo Ersek <ler...@redhat.com>
>> ---
>>
>> Notes:
>>     lightly tested, as these modules (except LoadFileOnFv2) are part of the
>>     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/FaultTolerantWriteDxe.c 
>> b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.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
>>
>>  #include <Library/UefiBootServicesTableLib.h>
>>  #include "FaultTolerantWrite.h"
>> -EFI_EVENT                                 mFvbRegistration = NULL;
>> +VOID                                      *mFvbRegistration = NULL;
>>
>>
>>  /**
>> diff --git 
>> a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c 
>> b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.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 <Protocol/MmEndOfDxe.h>
>>
>> -EFI_EVENT                                 mFvbRegistration = NULL;
>> +VOID                                      *mFvbRegistration = NULL;
>>  EFI_FTW_DEVICE                            *mFtwDevice      = NULL;
>>
>>  ///
>> diff --git a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c 
>> b/MdeModulePkg/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_FV2_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_FV2_PRIVATE_DATA, Link, LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE)
>>
>> -EFI_EVENT  mFvRegistration;
>> +VOID       *mFvRegistration;
>>  LIST_ENTRY mPrivateDataList;
>>
>>  /**
>> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c 
>> b/MdeModulePkg/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
>>
>>  EFI_HANDLE                          mHandle                    = NULL;
>>  EFI_EVENT                           mVirtualAddressChangeEvent = NULL;
>> -EFI_EVENT                           mFtwRegistration           = NULL;
>> +VOID                                *mFtwRegistration          = NULL;
>>  VOID                                ***mVarCheckAddressPointer = NULL;
>>  UINTN                               mVarCheckAddressPointerCount = 0;
>>  EDKII_VARIABLE_LOCK_PROTOCOL        mVariableLock              = { 
>> VariableLockRequestToLock };
> 
> Surprisingly the one declared in
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c is correct :)

Indeed!

> 
> Reviewed-by: Philippe Mathieu-Daude <phi...@redhat.com>

Thanks!
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48093): https://edk2.groups.io/g/devel/message/48093
Mute This Topic: https://groups.io/mt/34180210/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to