From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DB76320958BD7 for ; Tue, 12 Sep 2017 02:37:30 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2017 02:40:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,382,1500966000"; d="scan'208";a="1171404334" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 12 Sep 2017 02:40:26 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Sep 2017 02:40:26 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Sep 2017 02:40:26 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.117]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.98]) with mapi id 14.03.0319.002; Tue, 12 Sep 2017 17:40:25 +0800 From: "Ni, Ruiyu" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Dong, Eric" , Paulo Alcantara , "Zeng, Star" Thread-Topic: [PATCH v3 2/3] MdeModulePkg/UdfDxe: Initialize the array after declaration Thread-Index: AQHTK6UQCwN8Kb7O0Uars3+TwSWEjqKw/rOQ Date: Tue, 12 Sep 2017 09:40:24 +0000 Deferred-Delivery: Tue, 12 Sep 2017 09:40:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BA2C0BD@SHSMSX104.ccr.corp.intel.com> References: <1505206576-406236-1-git-send-email-dandan.bi@intel.com> <1505206576-406236-3-git-send-email-dandan.bi@intel.com> In-Reply-To: <1505206576-406236-3-git-send-email-dandan.bi@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v3 2/3] MdeModulePkg/UdfDxe: Initialize the array after declaration X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2017 09:37:31 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Thanks/Ray > -----Original Message----- > From: Bi, Dandan > Sent: Tuesday, September 12, 2017 4:56 PM > To: edk2-devel@lists.01.org > Cc: Dong, Eric ; Paulo Alcantara ; > Ni, Ruiyu ; Zeng, Star > Subject: [PATCH v3 2/3] MdeModulePkg/UdfDxe: Initialize the array after > declaration >=20 > Initialize the array DescriptorLBAs[] after declaration to fix non-consta= nt > aggregate initializer warning in VS tool chains. >=20 > Cc: Eric Dong > Cc: Paulo Alcantara > Cc: Ruiyu Ni > Cc: Star Zeng > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Dandan Bi > --- > MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 13 > ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c > b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c > index 5c5b5e3..904262a 100644 > --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c > +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c > @@ -20,15 +20,22 @@ FindAnchorVolumeDescriptorPointer ( > IN EFI_DISK_IO_PROTOCOL *DiskIo, > OUT UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER *AnchorPoint > ) > { > EFI_STATUS Status; > - UINT32 BlockSize =3D BlockIo->Media->BlockSize; > - EFI_LBA EndLBA =3D BlockIo->Media->LastBlock; > - EFI_LBA DescriptorLBAs[] =3D { 256, EndLBA - 256, EndLBA, 512 }; > + UINT32 BlockSize; > + EFI_LBA EndLBA; > + EFI_LBA DescriptorLBAs[4]; > UINTN Index; >=20 > + BlockSize =3D BlockIo->Media->BlockSize; EndLBA =3D > + BlockIo->Media->LastBlock; DescriptorLBAs[0] =3D 256; > + DescriptorLBAs[1] =3D EndLBA - 256; DescriptorLBAs[2] =3D EndLBA; > + DescriptorLBAs[3] =3D 512; > + > for (Index =3D 0; Index < ARRAY_SIZE (DescriptorLBAs); Index++) { > Status =3D DiskIo->ReadDisk ( > DiskIo, > BlockIo->Media->MediaId, > MultU64x32 (DescriptorLBAs[Index], BlockSize), > -- > 1.9.5.msysgit.1