From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5ADC61A1E43 for ; Wed, 26 Oct 2016 18:50:56 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 26 Oct 2016 18:50:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,404,1473145200"; d="scan'208";a="1076374842" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 26 Oct 2016 18:50:56 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 26 Oct 2016 18:50:55 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 26 Oct 2016 18:50:55 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.209]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.96]) with mapi id 14.03.0248.002; Thu, 27 Oct 2016 09:50:51 +0800 From: "Ni, Ruiyu" To: Laszlo Ersek , edk2-devel-01 CC: "Tian, Feng" , "Zeng, Star" Thread-Topic: [PATCH 25/47] MdeModulePkg/UefiBootManagerLib: rebase to ARRAY_SIZE() Thread-Index: AQHSL7wCxvFKxnGMOE2XMLo9wqpdAqC7iZmw Date: Thu, 27 Oct 2016 01:50:51 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D58E42D9C@SHSMSX104.ccr.corp.intel.com> References: <20161026190504.9888-1-lersek@redhat.com> <20161026190504.9888-26-lersek@redhat.com> In-Reply-To: <20161026190504.9888-26-lersek@redhat.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWY2Yzg0N2MtNDFmMy00Y2MxLTllZjAtYzZhZDJiMDIwOWJkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkFnb21WYmpZQnJYNEFBeEVVb0YrT2dZS3NXaUp0YnNEK01ueWhWN3hnTkk9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 25/47] MdeModulePkg/UefiBootManagerLib: 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 01:50:56 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Regards, Ray >-----Original Message----- >From: Laszlo Ersek [mailto:lersek@redhat.com] >Sent: Thursday, October 27, 2016 3:05 AM >To: edk2-devel-01 >Cc: Tian, Feng ; Ni, Ruiyu ; Zeng= , Star >Subject: [PATCH 25/47] MdeModulePkg/UefiBootManagerLib: rebase to ARRAY_SI= ZE() > >Cc: Feng Tian >Cc: Ruiyu Ni >Cc: Star Zeng >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Laszlo Ersek >--- > MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c | 2 +- > MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c | 2 +- > MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c | 2 +- > MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c | 4 ++-- > 4 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c >b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c >index f086764f24da..050647d8f186 100644 >--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c >+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c >@@ -632,7 +632,7 @@ BmGetBootDescription ( > // Firstly get the default boot description > // > DefaultDescription =3D NULL; >- for (Index =3D 0; Index < sizeof (mBmBootDescriptionHandlers) / sizeof = (mBmBootDescriptionHandlers[0]); Index++) { >+ for (Index =3D 0; Index < ARRAY_SIZE (mBmBootDescriptionHandlers); Inde= x++) { > DefaultDescription =3D mBmBootDescriptionHandlers[Index] (Handle); > if (DefaultDescription !=3D NULL) { > // >diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c >b/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c >index a13917bd0844..43895e10f85b 100644 >--- a/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c >+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c >@@ -430,7 +430,7 @@ EfiBootManagerUpdateConsoleVariable ( > EFI_DEVICE_PATH_PROTOCOL *NewDevicePath; > EFI_DEVICE_PATH_PROTOCOL *TempNewDevicePath; > >- if (ConsoleType >=3D sizeof (mConVarName) / sizeof (mConVarName[0])) { >+ if (ConsoleType >=3D ARRAY_SIZE (mConVarName)) { > return EFI_INVALID_PARAMETER; > } > >diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c >b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c >index 55df7e9a5f31..35131a94f61d 100644 >--- a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c >+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c >@@ -680,7 +680,7 @@ BmProcessKeyOption ( > > KeyShiftStateCount =3D 0; > BmGenerateKeyShiftState (0, KeyOption, EFI_SHIFT_STATE_VALID, KeyShiftS= tates, &KeyShiftStateCount); >- ASSERT (KeyShiftStateCount <=3D sizeof (KeyShiftStates) / sizeof (KeySh= iftStates[0])); >+ ASSERT (KeyShiftStateCount <=3D ARRAY_SIZE (KeyShiftStates)); > > EfiAcquireLock (&mBmHotkeyLock); > >diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c >b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c >index 9af98de0afaf..e638e5fc67e6 100644 >--- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c >+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c >@@ -796,7 +796,7 @@ EfiBootManagerIsValidLoadOptionVariableName ( > return FALSE; > } > >- for (Index =3D 0; Index < sizeof (mBmLoadOptionName) / sizeof (mBmLoadO= ptionName[0]); Index++) { >+ for (Index =3D 0; Index < ARRAY_SIZE (mBmLoadOptionName); Index++) { > if ((VariableNameLen - 4 =3D=3D StrLen (mBmLoadOptionName[Index])) && > (StrnCmp (VariableName, mBmLoadOptionName[Index], VariableNameLen= - 4) =3D=3D 0) > ) { >@@ -804,7 +804,7 @@ EfiBootManagerIsValidLoadOptionVariableName ( > } > } > >- if (Index =3D=3D sizeof (mBmLoadOptionName) / sizeof (mBmLoadOptionName= [0])) { >+ if (Index =3D=3D ARRAY_SIZE (mBmLoadOptionName)) { > return FALSE; > } > >-- >2.9.2 >