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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6751A20958BD7 for ; Tue, 12 Sep 2017 02:37:31 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.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="1217676605" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 12 Sep 2017 02:40:27 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Sep 2017 02:40:27 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Sep 2017 02:40:27 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.117]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.219]) 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" , "Zeng, Star" Thread-Topic: [edk2] [PATCH v3 3/3] MdeModulePkg/PartitionDxe: Initialize the array after declaration Thread-Index: AQHTK6UPmKCJLwqnt0+PCeWyzshHEKKw/qVQ Date: Tue, 12 Sep 2017 09:40:24 +0000 Deferred-Delivery: Tue, 12 Sep 2017 09:40:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BA2C0B3@SHSMSX104.ccr.corp.intel.com> References: <1505206576-406236-1-git-send-email-dandan.bi@intel.com> <1505206576-406236-4-git-send-email-dandan.bi@intel.com> In-Reply-To: <1505206576-406236-4-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 3/3] MdeModulePkg/PartitionDxe: 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: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Dandan Bi > Sent: Tuesday, September 12, 2017 4:56 PM > To: edk2-devel@lists.01.org > Cc: Ni, Ruiyu ; Dong, Eric ; Zen= g, > Star > Subject: [edk2] [PATCH v3 3/3] MdeModulePkg/PartitionDxe: 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/PartitionDxe/Udf.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c > b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c > index c1d4480..3174ab2 100644 > --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c > +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c > @@ -46,15 +46,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 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel