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:15 -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 1250237E88; Tue, 17 Sep 2019 19:50:15 +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 99ADA600C4; Tue, 17 Sep 2019 19:50:13 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Eric Dong , Hao A Wu , Jian J Wang , Ray Ni Subject: [PATCH 15/35] MdeModulePkg/PiSmmCore: make type punning consistent Date: Tue, 17 Sep 2019 21:49:15 +0200 Message-Id: <20190917194935.24322-16-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.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 17 Sep 2019 19:50:15 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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 OV= MF 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/PiSmmC= ore/Smi.c index f8bd9f49ee3c..488af6754faf 100644 --- a/MdeModulePkg/Core/PiSmmCore/Smi.c +++ b/MdeModulePkg/Core/PiSmmCore/Smi.c @@ -282,7 +282,7 @@ SmiHandlerUnRegister ( // SmiHandler =3D NULL; for ( HandlerLink =3D GetFirstNode (&mRootSmiEntry.SmiHandlers) - ; !IsNull (&mRootSmiEntry.SmiHandlers, HandlerLink) && (SmiHandler= !=3D DispatchHandle) + ; !IsNull (&mRootSmiEntry.SmiHandlers, HandlerLink) && ((EFI_HANDL= E) SmiHandler !=3D DispatchHandle) ; HandlerLink =3D GetNextNode (&mRootSmiEntry.SmiHandlers, Handler= Link) ) { SmiHandler =3D CR (HandlerLink, SMI_HANDLER, Link, SMI_HANDLER_SIGNA= TURE); @@ -292,19 +292,19 @@ SmiHandlerUnRegister ( // Look for it in non-root SMI handlers // for ( EntryLink =3D GetFirstNode (&mSmiEntryList) - ; !IsNull (&mSmiEntryList, EntryLink) && (SmiHandler !=3D Dispatch= Handle) + ; !IsNull (&mSmiEntryList, EntryLink) && ((EFI_HANDLE) SmiHandler = !=3D DispatchHandle) ; EntryLink =3D GetNextNode (&mSmiEntryList, EntryLink) ) { SmiEntry =3D CR (EntryLink, SMI_ENTRY, AllEntries, SMI_ENTRY_SIGNATU= RE); for ( HandlerLink =3D GetFirstNode (&SmiEntry->SmiHandlers) - ; !IsNull (&SmiEntry->SmiHandlers, HandlerLink) && (SmiHandler != =3D DispatchHandle) + ; !IsNull (&SmiEntry->SmiHandlers, HandlerLink) && ((EFI_HANDLE)= SmiHandler !=3D DispatchHandle) ; HandlerLink =3D GetNextNode (&SmiEntry->SmiHandlers, HandlerLi= nk) ) { SmiHandler =3D CR (HandlerLink, SMI_HANDLER, Link, SMI_HANDLER_SIG= NATURE); } } =20 - if (SmiHandler !=3D DispatchHandle) { + if ((EFI_HANDLE) SmiHandler !=3D DispatchHandle) { return EFI_INVALID_PARAMETER; } =20 --=20 2.19.1.3.g30247aa5d201