From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x231.google.com (mail-wr0-x231.google.com [IPv6:2a00:1450:400c:c0c::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 49F9021EB88E3 for ; Fri, 1 Sep 2017 08:48:28 -0700 (PDT) Received: by mail-wr0-x231.google.com with SMTP id 40so1526255wrv.5 for ; Fri, 01 Sep 2017 08:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6EClRY40hmsqgADtu5NN3MT2v7UTiezcoL/J9mo2poE=; b=VcpWzlTs5Qn/7MuATBh34+t2By0qwRf8QzAcidJmO2MFzrGvSncqinNdbdWoTl+2UK HgKt3YqM0nKkJSirpdC4rWYJPMYoKxHwQ22HGb6Phdfnc6ggorVNEuVyva/Xb2RMvNql g4fFIDz1EhV8FRCqX5SqRSudcDMU4ltW9vzhw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6EClRY40hmsqgADtu5NN3MT2v7UTiezcoL/J9mo2poE=; b=V8yZcEwaAlxnpy9tPvJ4XLafPpyiqxZ6rAd9Mr6YNYGvv41tfdV2Pxf9aiTmLiLNYS Y98bjG+/zB6vPu/pVS5GxfFpsguP4TnbWmHar6e/q3eOD75mXsypwWN249+lDULI/6QY X7Tt/YC+14lZjHaBZPJf0Cyf/p79GjLXLtoR7efZzWsqfYv7XTG0JS1wiJuXnIfip4wj n6QZuDLZucyJgEDeHlnG9RuFkVIz9onHFyg6jAXaSX9wyw2YK4LCSxrxRD8C2POJxVUT a3zgl5iTQFBL+OK5fXLhzLYVCSeK49sWQlOG11fYkBNBwP42E47GMijJzj1HI2b4ElrP wBEQ== X-Gm-Message-State: AHPjjUheMXHp6N8D82mo3TdIccSZN6C+rvcusiUqTbdeFkJfpMjjsgF/ nrKZl+EJSBfA4tsf X-Google-Smtp-Source: ADKCNb6DJrNL8w5VK+lPQ9Ixf5ol+BCZC+P20JkQeSsepVtGK/giSHYKMDtHHM+7/IvaBntSijxsLQ== X-Received: by 10.223.149.97 with SMTP id 88mr1481729wrs.305.1504281071431; Fri, 01 Sep 2017 08:51:11 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id s77sm343376wmd.6.2017.09.01.08.51.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Sep 2017 08:51:10 -0700 (PDT) Date: Fri, 1 Sep 2017 16:51:08 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: Marcin Wojtas , "edk2-devel@lists.01.org" , Nadav Haklai , Neta Zur Hershkovits , Kostya Porotchkin , Hua Jing , Alexander Graf , Jan =?utf-8?B?RMSFYnJvxZs=?= Message-ID: <20170901155108.kygqbersidnfibqf@bivouac.eciton.net> References: <1504271303-1782-1-git-send-email-mw@semihalf.com> <1504271303-1782-8-git-send-email-mw@semihalf.com> <20170901145450.ratc5spdlwlgzob2@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [platforms: PATCH 07/11] Applications/FirmwareUpdate: Fix 32-bit issues 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, 01 Sep 2017 15:48:28 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 01, 2017 at 04:16:24PM +0100, Ard Biesheuvel wrote: > On 1 September 2017 at 15:54, Leif Lindholm wrote: > > On Fri, Sep 01, 2017 at 03:08:19PM +0200, Marcin Wojtas wrote: > >> From: Ard Biesheuvel > >> > >> Fix casting and related issues to make this code build for 32-bit ARM. > >> > >> Contributed-under: TianoCore Contribution Agreement 1.1 > >> Signed-off-by: Ard Biesheuvel > >> Signed-off-by: Marcin Wojtas > >> --- > >> Platform/Marvell/Applications/FirmwareUpdate/FUpdate.c | 5 ++++- > >> 1 file changed, 4 insertions(+), 1 deletion(-) > >> > >> diff --git a/Platform/Marvell/Applications/FirmwareUpdate/FUpdate.c b/Platform/Marvell/Applications/FirmwareUpdate/FUpdate.c > >> index edb6986..0951734 100644 > >> --- a/Platform/Marvell/Applications/FirmwareUpdate/FUpdate.c > >> +++ b/Platform/Marvell/Applications/FirmwareUpdate/FUpdate.c > >> @@ -172,6 +172,7 @@ PrepareFirmwareImage ( > >> EFI_STATUS Status; > >> UINT64 OpenMode; > >> UINTN *Buffer; > >> + UINT64 Size; > >> > >> // Parse string from commandline > >> FileStr = ShellCommandLineGetRawValue (CheckPackage, 1); > >> @@ -195,11 +196,13 @@ PrepareFirmwareImage ( > >> return EFI_DEVICE_ERROR; > >> } > >> > >> - Status = FileHandleGetSize (*FileHandle, FileSize); > >> + Status = FileHandleGetSize (*FileHandle, &Size); > >> if (EFI_ERROR (Status)) { > >> Print (L"%s: Cannot get Image file size\n", CMD_NAME_STRING); > >> } > >> > >> + *FileSize = (UINTN)Size; > >> + > > > > Rather than juggling around with temporary variables, why not make > > FileSize in ShellCommandRunFUpdate() UINT64 and update > > PrepareFirmwareImage() prototype accordingly? > > I don't remember /exactly/, but I think it breaks in another place then. The only thing I see that _could_ be affected is Status = SpiFlashProtocol->Update (Slave, 0, FileSize, (UINT8 *)FileBuffer); And I would prefer a (UINTN) cast there over temporary variable shuffling in a subfunction. / Leif