From nobody Thu Dec 26 12:44:02 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1505206589783849.0495546619627; Tue, 12 Sep 2017 01:56:29 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 48D8821D492D2; Tue, 12 Sep 2017 01:53:32 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 C995A21CEB103 for ; Tue, 12 Sep 2017 01:53:30 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 12 Sep 2017 01:56:27 -0700 Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga002.jf.intel.com with ESMTP; 12 Sep 2017 01:56:25 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,382,1500966000"; d="scan'208";a="134382810" From: Dandan Bi To: edk2-devel@lists.01.org Date: Tue, 12 Sep 2017 16:56:15 +0800 Message-Id: <1505206576-406236-3-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1505206576-406236-1-git-send-email-dandan.bi@intel.com> References: <1505206576-406236-1-git-send-email-dandan.bi@intel.com> Subject: [edk2] [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: , Cc: Ruiyu Ni , Eric Dong , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Initialize the array DescriptorLBAs[] after declaration to fix non-constant aggregate initializer warning in VS tool chains. Cc: Eric Dong Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Ruiyu Ni --- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 13 ++++++++++-= -- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/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), --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel