From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 22CD021AEBABF for ; Thu, 18 May 2017 18:49:26 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 May 2017 18:49:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,361,1491289200"; d="scan'208";a="858878491" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 18 May 2017 18:49:25 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 18 May 2017 18:49:25 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 18 May 2017 18:49:25 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.193]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.117]) with mapi id 14.03.0319.002; Fri, 19 May 2017 09:49:23 +0800 From: "Wei, David" To: Laszlo Ersek , edk2-devel-01 CC: "Justen, Jordan L" , "Guo, Mang" , "Wei, David" Thread-Topic: [PATCH 8/8] Vlv2TbltDevicePkg/FvbRuntimeDxe: correct NumOfLba vararg type in EraseBlocks() Thread-Index: AQHSz+ghL1lLylGoikqZxpq1LhqQ+qH65DAA Date: Fri, 19 May 2017 01:49:22 +0000 Message-ID: <89954A0B46707A448411A627AD4EEE3468F328E4@SHSMSX101.ccr.corp.intel.com> References: <20170518150427.16435-1-lersek@redhat.com> <20170518150427.16435-9-lersek@redhat.com> In-Reply-To: <20170518150427.16435-9-lersek@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 8/8] Vlv2TbltDevicePkg/FvbRuntimeDxe: correct NumOfLba vararg type in EraseBlocks() 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: Fri, 19 May 2017 01:49:26 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: zwei4 =20 Thanks, David Wei =20 -----Original Message----- From: Laszlo Ersek [mailto:lersek@redhat.com]=20 Sent: Thursday, May 18, 2017 11:04 PM To: edk2-devel-01 Cc: Wei, David ; Justen, Jordan L ; Guo, Mang Subject: [PATCH 8/8] Vlv2TbltDevicePkg/FvbRuntimeDxe: correct NumOfLba vara= rg type in EraseBlocks() According to the PI spec, Volume 3, EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.EraseBlocks(): > The variable argument list is a list of tuples. Each tuple describes a > range of LBAs to erase and consists of the following: > * An EFI_LBA that indicates the starting LBA > * A UINTN that indicates the number of blocks to erase (NB, in edk2, EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL is a typedef to EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.) In this driver, the NumOfLba local variable is defined with type UINTN, but the TYPE argument passed to VA_ARG() is UINT32. Fix the mismatch. Cc: David Wei Cc: Jordan Justen Cc: Mang Guo Reported-by: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- Notes: unbuilt, untested Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c | 4 ++-- Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbSmmDxe.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c b/Vlv2TbltDeviceP= kg/FvbRuntimeDxe/FvbService.c index b0013f918368..89b941042420 100644 --- a/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c +++ b/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c @@ -793,7 +793,7 @@ FvbProtocolEraseBlocks ( break; } =20 - NumOfLba =3D VA_ARG (args, UINT32); + NumOfLba =3D VA_ARG (args, UINTN); =20 // // Check input parameters. @@ -817,7 +817,7 @@ FvbProtocolEraseBlocks ( break; } =20 - NumOfLba =3D VA_ARG (args, UINT32); + NumOfLba =3D VA_ARG (args, UINTN); =20 while ( NumOfLba > 0 ) { Status =3D FvbEraseBlock (FvbDevice->Instance, StartingLba); diff --git a/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbSmmDxe.c b/Vlv2TbltDevicePk= g/FvbRuntimeDxe/FvbSmmDxe.c index 20aaf8720f72..22a4bdcdd492 100644 --- a/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbSmmDxe.c +++ b/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbSmmDxe.c @@ -725,7 +725,7 @@ FvbEraseBlocks ( break; } =20 - NumOfLba =3D VA_ARG (Marker, UINT32); + NumOfLba =3D VA_ARG (Marker, UINTN); if (NumOfLba =3D=3D 0) { return EFI_INVALID_PARAMETER; } @@ -742,7 +742,7 @@ FvbEraseBlocks ( if (StartingLba =3D=3D EFI_LBA_LIST_TERMINATOR ) { break; } - NumOfLba =3D VA_ARG (Marker, UINT32); + NumOfLba =3D VA_ARG (Marker, UINTN); Status =3D EraseBlock (This, StartingLba, NumOfLba); if (EFI_ERROR (Status)) { break; --=20 2.9.3