From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x22f.google.com (mail-wr0-x22f.google.com [IPv6:2a00:1450:400c:c0c::22f]) (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 0A93B21EB88E0 for ; Fri, 1 Sep 2017 07:52:11 -0700 (PDT) Received: by mail-wr0-x22f.google.com with SMTP id k9so1181676wre.4 for ; Fri, 01 Sep 2017 07:54:55 -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=kQt/e6NFRW8bImJK7a93UtPJ/cTyjHvMWKS5SixJKnk=; b=iduNSgp+XZ8vw1AWB9tysfPdGFggwlXWWYZAkkcI0R+7SuAw3j6B3FsCReRUWqvKl3 INrrYp9MQl4FvIBMCZwyA/wD1X7SXrPpwVqvKQWiTr951JdWFv0sIo01MEEFeUjkHElV JACzFyn80ODHmUYyY1FXe7nLshkDAKIXeg0QE= 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=kQt/e6NFRW8bImJK7a93UtPJ/cTyjHvMWKS5SixJKnk=; b=Z5oLofQhhONrDCL/vOB2yFS17wRN7XOtpE7O1irJQlR8SSW6o3/kGEWo91FXqzmMMa OAK5PYaTnf4RqKmf8I59tkpo46PuDHixrl82plvy5uX1KLBVd/wwnIH0LAKKexDTGq86 1hv4SB4Bet5vxsJekI9CD7PCOqRHkX3HLFpxGeBaNicsLHOtcTq9tddr0MfpB2DjphIQ WPdZaJuKqsAxnQKbySTwfzMbTcYrW7kfGJEeii1JnNVsfJCPvnLgs/4sfulYewzwr39E xY7DX8u2t1/Yllf6b4uPTdv3BHJQpLTS2TgJrff+iFvUkL/49BdTtnfnxG661DWnkZYM cP6g== X-Gm-Message-State: AHPjjUh8cKPTEJAKCjgdPNpqDMtd1yY+tj+aWz7poEVVMn22OLuddSJS 5CQwo0TPs5yOIZ6D X-Google-Smtp-Source: ADKCNb7GgxBQhdb5OpQA9FR3kf6lwths+Fz35x4LXyb5p0dNhcLu8acxwfkC2mhQjVYJIXjZoUi/zQ== X-Received: by 10.223.151.195 with SMTP id t3mr1290841wrb.239.1504277694287; Fri, 01 Sep 2017 07:54:54 -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 q64sm271035wmg.42.2017.09.01.07.54.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Sep 2017 07:54:52 -0700 (PDT) Date: Fri, 1 Sep 2017 15:54:50 +0100 From: Leif Lindholm To: Marcin Wojtas Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com, jinghua@marvell.com, agraf@suse.de, jsd@semihalf.com Message-ID: <20170901145450.ratc5spdlwlgzob2@bivouac.eciton.net> References: <1504271303-1782-1-git-send-email-mw@semihalf.com> <1504271303-1782-8-git-send-email-mw@semihalf.com> MIME-Version: 1.0 In-Reply-To: <1504271303-1782-8-git-send-email-mw@semihalf.com> 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 14:52:11 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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? / Leif > // Read Image header into buffer > Buffer = AllocateZeroPool (*FileSize); > > -- > 1.8.3.1 >