From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: eric.dong@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Tue, 17 Sep 2019 19:38:33 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2019 19:38:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,519,1559545200"; d="scan'208";a="362045384" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 17 Sep 2019 19:38:32 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 17 Sep 2019 19:38:31 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.113]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.92]) with mapi id 14.03.0439.000; Wed, 18 Sep 2019 10:38:30 +0800 From: "Dong, Eric" To: Laszlo Ersek , edk2-devel-groups-io CC: "Wu, Hao A" , "Wang, Jian J" , "Ni, Ray" Subject: Re: [PATCH 15/35] MdeModulePkg/PiSmmCore: make type punning consistent Thread-Topic: [PATCH 15/35] MdeModulePkg/PiSmmCore: make type punning consistent Thread-Index: AQHVbZEhoh8r3G8smkCpBktIIVgCM6cwuRUw Date: Wed, 18 Sep 2019 02:38:30 +0000 Message-ID: References: <20190917194935.24322-1-lersek@redhat.com> <20190917194935.24322-16-lersek@redhat.com> In-Reply-To: <20190917194935.24322-16-lersek@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: eric.dong@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@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 >=20 > The SmiHandlerRegister() function explicitly casts "SmiHandler" (of type > (SMI_HANDLER*)) to EFI_HANDLE, when outputting "DispatchHandle". >=20 > Apply the same cast in the counterpart function SmiHandlerUnRegister(), > which compares multiple "SmiHandler"s against the input "DispatchHandle". >=20 > This is a semantic cleanup; there is no functional change. >=20 > Cc: Eric Dong > Cc: Hao A Wu > Cc: Jian J Wang > Cc: Ray Ni > Signed-off-by: Laszlo Ersek > --- >=20 > Notes: > build-tested only, most likely -- I'm unaware of any code paths in OV= MF > that would lead to SmiHandlerUnRegister() >=20 > MdeModulePkg/Core/PiSmmCore/Smi.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > 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 =3D NULL; > for ( HandlerLink =3D GetFirstNode (&mRootSmiEntry.SmiHandlers) > - ; !IsNull (&mRootSmiEntry.SmiHandlers, HandlerLink) && (SmiHandler= !=3D > DispatchHandle) > + ; !IsNull (&mRootSmiEntry.SmiHandlers, HandlerLink) && > + ((EFI_HANDLE) SmiHandler !=3D DispatchHandle) > ; HandlerLink =3D GetNextNode (&mRootSmiEntry.SmiHandlers, Handler= Link) > ) { > SmiHandler =3D CR (HandlerLink, SMI_HANDLER, Link, > SMI_HANDLER_SIGNATURE); @@ -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_SIGNATURE); > } > } >=20 > - if (SmiHandler !=3D DispatchHandle) { > + if ((EFI_HANDLE) SmiHandler !=3D DispatchHandle) { > return EFI_INVALID_PARAMETER; > } >=20 > -- > 2.19.1.3.g30247aa5d201 >=20