From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 317141A1E43 for ; Wed, 26 Oct 2016 18:53:53 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP; 26 Oct 2016 18:53:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,404,1473145200"; d="scan'208";a="24212419" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 26 Oct 2016 18:53:52 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 26 Oct 2016 18:53:52 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 26 Oct 2016 18:53:52 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.209]) by shsmsx102.ccr.corp.intel.com ([169.254.2.206]) with mapi id 14.03.0248.002; Thu, 27 Oct 2016 09:53:49 +0800 From: "Ni, Ruiyu" To: Laszlo Ersek , edk2-devel-01 Thread-Topic: [PATCH 14/47] FatPkg/EnhancedFatDxe: rebase to ARRAY_SIZE() Thread-Index: AQHSL7v7tao+RNjwg0GEYUns8PTuFqC7ii1Q Date: Thu, 27 Oct 2016 01:53:49 +0000 Deferred-Delivery: Thu, 27 Oct 2016 01:53:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D58E42E23@SHSMSX104.ccr.corp.intel.com> References: <20161026190504.9888-1-lersek@redhat.com> <20161026190504.9888-15-lersek@redhat.com> In-Reply-To: <20161026190504.9888-15-lersek@redhat.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmJlY2NkZmMtOWE5Ny00NzJhLWEwZjUtZTlkODkxNjcxMGQxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS45LjYuNiIsIlRydXN0ZWRMYWJlbEhhc2giOiIwXC9oalNnMTFrRWtlS2NOQjY0SHhQTVdkZDJTQzNDUkhpVUxabFREKzJXVT0ifQ== x-ctpclassification: CTP_PUBLIC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 14/47] FatPkg/EnhancedFatDxe: 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:53:53 -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: Ni, Ruiyu >Subject: [PATCH 14/47] FatPkg/EnhancedFatDxe: rebase to ARRAY_SIZE() > >Cc: Ruiyu Ni >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Laszlo Ersek >--- > FatPkg/EnhancedFatDxe/DirectoryManage.c | 4 ++-- > FatPkg/EnhancedFatDxe/FileName.c | 4 ++-- > FatPkg/EnhancedFatDxe/Hash.c | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/FatPkg/EnhancedFatDxe/DirectoryManage.c b/FatPkg/EnhancedFatD= xe/DirectoryManage.c >index 91e7599e2722..3328ae31fed9 100644 >--- a/FatPkg/EnhancedFatDxe/DirectoryManage.c >+++ b/FatPkg/EnhancedFatDxe/DirectoryManage.c >@@ -118,7 +118,7 @@ Returns: > SetMem (LfnBuffer, sizeof (CHAR16) * LFN_CHAR_TOTAL * EntryCount, 0xf= f); > Status =3D StrCpyS ( > LfnBuffer, >- sizeof (LfnBuffer) / sizeof (LfnBuffer[0]), >+ ARRAY_SIZE (LfnBuffer), > DirEnt->FileString > ); > if (EFI_ERROR (Status)) { >@@ -360,7 +360,7 @@ Returns: > FatGetFileNameViaCaseFlag ( > DirEnt, > LfnBuffer, >- sizeof (LfnBuffer) / sizeof (LfnBuffer[0]) >+ ARRAY_SIZE (LfnBuffer) > ); > } > >diff --git a/FatPkg/EnhancedFatDxe/FileName.c b/FatPkg/EnhancedFatDxe/File= Name.c >index 551cda53b9a4..5df403625d64 100644 >--- a/FatPkg/EnhancedFatDxe/FileName.c >+++ b/FatPkg/EnhancedFatDxe/FileName.c >@@ -310,7 +310,7 @@ Returns: > // Lower case a copy of the string, if it matches the > // original then the string is lower case > // >- StrCpyS (Buffer, sizeof (Buffer) / sizeof (Buffer[0]), Str); >+ StrCpyS (Buffer, ARRAY_SIZE (Buffer), Str); > FatStrLwr (Buffer); > if (StrCmp (Str, Buffer) =3D=3D 0) { > OutCaseFlag =3D InCaseFlag; >@@ -319,7 +319,7 @@ Returns: > // Upper case a copy of the string, if it matches the > // original then the string is upper case > // >- StrCpyS (Buffer, sizeof (Buffer) / sizeof (Buffer[0]), Str); >+ StrCpyS (Buffer, ARRAY_SIZE (Buffer), Str); > FatStrUpr (Buffer); > if (StrCmp (Str, Buffer) =3D=3D 0) { > OutCaseFlag =3D 0; >diff --git a/FatPkg/EnhancedFatDxe/Hash.c b/FatPkg/EnhancedFatDxe/Hash.c >index 3d0ffe6fb879..f827368ef5eb 100644 >--- a/FatPkg/EnhancedFatDxe/Hash.c >+++ b/FatPkg/EnhancedFatDxe/Hash.c >@@ -49,9 +49,9 @@ Returns: > CHAR16 UpCasedLongFileName[EFI_PATH_STRING_LENGTH]; > StrnCpyS ( > UpCasedLongFileName, >- sizeof (UpCasedLongFileName) / sizeof (UpCasedLongFileName[0]), >+ ARRAY_SIZE (UpCasedLongFileName), > LongNameString, >- sizeof (UpCasedLongFileName) / sizeof (UpCasedLongFileName[0]) - 1 >+ ARRAY_SIZE (UpCasedLongFileName) - 1 > ); > FatStrUpr (UpCasedLongFileName); > gBS->CalculateCrc32 (UpCasedLongFileName, StrSize (UpCasedLongFileName)= , &HashValue); >-- >2.9.2 >