From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B38F01A1E43 for ; Wed, 26 Oct 2016 19:20:42 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP; 26 Oct 2016 19:20:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,404,1473145200"; d="scan'208";a="778298274" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by FMSMGA003.fm.intel.com with ESMTP; 26 Oct 2016 19:20:42 -0700 Received: from orsmsx157.amr.corp.intel.com (10.22.240.23) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 26 Oct 2016 19:20:41 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.50]) by ORSMSX157.amr.corp.intel.com ([169.254.9.154]) with mapi id 14.03.0248.002; Wed, 26 Oct 2016 19:20:41 -0700 From: "Kinney, Michael D" To: Laszlo Ersek , edk2-devel-01 , "Kinney, Michael D" CC: "Tian, Feng" , "Zeng, Star" Thread-Topic: [PATCH 22/47] MdeModulePkg/Core/PiSmmCore: rebase to ARRAY_SIZE() Thread-Index: AQHSL7v+hBjo54mr30+sEAxQmVJAP6C7kcyw Date: Thu, 27 Oct 2016 02:20:40 +0000 Message-ID: References: <20161026190504.9888-1-lersek@redhat.com> <20161026190504.9888-23-lersek@redhat.com> In-Reply-To: <20161026190504.9888-23-lersek@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNThlM2UxOTMtNWUzYi00ZTc4LWI5MmQtMDhjMjhkMGI2OTAwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjI0RUVsME5FTU9qakVmMVYxN0JUTUdRODA5Smozcjl4Z2FrREJBS0swQmc9In0= x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Subject: Re: [PATCH 22/47] MdeModulePkg/Core/PiSmmCore: rebase to ARRAY_SIZE() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2016 02:20:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Kinney > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@redhat.com] > Sent: Wednesday, October 26, 2016 12:05 PM > To: edk2-devel-01 > Cc: Tian, Feng ; Kinney, Michael D ; > Zeng, Star > Subject: [PATCH 22/47] MdeModulePkg/Core/PiSmmCore: rebase to ARRAY_SIZE(= ) >=20 > Cc: Feng Tian > Cc: Michael D Kinney > Cc: Star Zeng > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Laszlo Ersek > --- > MdeModulePkg/Core/PiSmmCore/Pool.c | 2 +- > MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c | 6 +++--- > 2 files changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c b/MdeModulePkg/Core/PiSmm= Core/Pool.c > index 9d447025883d..02dab0142560 100644 > --- a/MdeModulePkg/Core/PiSmmCore/Pool.c > +++ b/MdeModulePkg/Core/PiSmmCore/Pool.c > @@ -42,7 +42,7 @@ SmmInitializeMemoryServices ( > // > // Initialize Pool list > // > - for (Index =3D sizeof (mSmmPoolLists) / sizeof (*mSmmPoolLists); Index= > 0;) { > + for (Index =3D ARRAY_SIZE (mSmmPoolLists); Index > 0;) { > InitializeListHead (&mSmmPoolLists[--Index]); > } > CurrentSmramRangesIndex =3D 0; > diff --git a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c > b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c > index 93585f199df9..d983cefbb3dc 100644 > --- a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c > +++ b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c > @@ -2670,7 +2670,7 @@ ProfileMemoryTypeToStr ( > ) > { > UINTN Index; > - for (Index =3D 0; Index < sizeof (mMemoryTypeString) / sizeof (mMemory= TypeString[0]); > Index++) { > + for (Index =3D 0; Index < ARRAY_SIZE (mMemoryTypeString); Index++) { > if (mMemoryTypeString[Index].MemoryType =3D=3D MemoryType) { > return mMemoryTypeString[Index].MemoryTypeStr; > } > @@ -2697,12 +2697,12 @@ ProfileActionToStr ( > CHAR8 **ActionString; >=20 > ActionString =3D mSmmActionString; > - ActionStringCount =3D sizeof (mSmmActionString) / sizeof (mSmmActionSt= ring[0]); > + ActionStringCount =3D ARRAY_SIZE (mSmmActionString); >=20 > if ((UINTN) (UINT32) Action < ActionStringCount) { > return ActionString[Action]; > } > - for (Index =3D 0; Index < sizeof (mExtActionString) / sizeof (mExtActi= onString[0]); > Index++) { > + for (Index =3D 0; Index < ARRAY_SIZE (mExtActionString); Index++) { > if (mExtActionString[Index].Action =3D=3D Action) { > return mExtActionString[Index].String; > } > -- > 2.9.2 >=20