Reviewed-by: Eric Dong
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Wednesday, September 18, 2019 3:49 AM
> To: edk2-devel-groups-io
> Cc: Dong, Eric ; Wu, Hao A ;
> Wang, Jian J ; Ni, Ray
> Subject: [PATCH 15/35] MdeModulePkg/PiSmmCore: make type punning
> consistent
>
> The SmiHandlerRegister() function explicitly casts "SmiHandler" (of type
> (SMI_HANDLER*)) to EFI_HANDLE, when outputting "DispatchHandle".
>
> Apply the same cast in the counterpart function SmiHandlerUnRegister(),
> which compares multiple "SmiHandler"s against the input "DispatchHandle".
>
> This is a semantic cleanup; there is no functional change.
>
> Cc: Eric Dong
> Cc: Hao A Wu
> Cc: Jian J Wang
> Cc: Ray Ni
> Signed-off-by: Laszlo Ersek
> ---
>
> Notes:
> build-tested only, most likely -- I'm unaware of any code paths in OVMF
> that would lead to SmiHandlerUnRegister()
>
> MdeModulePkg/Core/PiSmmCore/Smi.c | 8
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/MdeModulePkg/Core/PiSmmCore/Smi.c
> b/MdeModulePkg/Core/PiSmmCore/Smi.c
> index f8bd9f49ee3c..488af6754faf 100644
> --- a/MdeModulePkg/Core/PiSmmCore/Smi.c
> +++ b/MdeModulePkg/Core/PiSmmCore/Smi.c
> @@ -282,7 +282,7 @@ SmiHandlerUnRegister (
>//
>SmiHandler = NULL;
>for ( HandlerLink = GetFirstNode ()
> - ; !IsNull (, HandlerLink) && (SmiHandler !=
> DispatchHandle)
> + ; !IsNull (, HandlerLink) &&
> + ((EFI_HANDLE) SmiHandler != DispatchHandle)
>; HandlerLink = GetNextNode (, HandlerLink)
>) {
> SmiHandler = CR (HandlerLink, SMI_HANDLER, Link,
> SMI_HANDLER_SIGNATURE); @@ -292,19 +292,19 @@
> SmiHandlerUnRegister (
>// Look for it in non-root SMI handlers
>//
>for ( EntryLink = GetFirstNode ()
> - ; !IsNull (, EntryLink) && (SmiHandler != DispatchHandle)
> + ; !IsNull (, EntryLink) && ((EFI_HANDLE) SmiHandler
> + != DispatchHandle)
>; EntryLink = GetNextNode (, EntryLink)
>) {
> SmiEntry = CR (EntryLink, SMI_ENTRY, AllEntries, SMI_ENTRY_SIGNATURE);
> for ( HandlerLink = GetFirstNode (>SmiHandlers)
> -; !IsNull (>SmiHandlers, HandlerLink) && (SmiHandler !=
> DispatchHandle)
> +; !IsNull (>SmiHandlers, HandlerLink) &&
> + ((EFI_HANDLE) SmiHandler != DispatchHandle)
> ; HandlerLink = GetNextNode (>SmiHandlers, HandlerLink)
> ) {
>SmiHandler = CR (HandlerLink, SMI_HANDLER, Link,
> SMI_HANDLER_SIGNATURE);
> }
>}
>
> - if (SmiHandler != DispatchHandle) {
> + if ((EFI_HANDLE) SmiHandler != DispatchHandle) {
> return EFI_INVALID_PARAMETER;
>}
>
> --
> 2.19.1.3.g30247aa5d201
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#47442): https://edk2.groups.io/g/devel/message/47442
Mute This Topic: https://groups.io/mt/34180216/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-