public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "Marcin Wojtas" <mw@semihalf.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Nadav Haklai" <nadavh@marvell.com>,
	"Neta Zur Hershkovits" <neta@marvell.com>,
	"Kostya Porotchkin" <kostap@marvell.com>,
	"Hua Jing" <jinghua@marvell.com>,
	"Alexander Graf" <agraf@suse.de>, "Jan Dąbroś" <jsd@semihalf.com>
Subject: Re: [platforms: PATCH 07/11] Applications/FirmwareUpdate: Fix 32-bit issues
Date: Fri, 1 Sep 2017 16:51:08 +0100	[thread overview]
Message-ID: <20170901155108.kygqbersidnfibqf@bivouac.eciton.net> (raw)
In-Reply-To: <CAKv+Gu9FvGT6BsU9N=3M8jeQdAbysuRhXeZHYya1p0xnc1SjjQ@mail.gmail.com>

On Fri, Sep 01, 2017 at 04:16:24PM +0100, Ard Biesheuvel wrote:
> On 1 September 2017 at 15:54, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> > On Fri, Sep 01, 2017 at 03:08:19PM +0200, Marcin Wojtas wrote:
> >> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >>
> >> 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 <ard.biesheuvel@linaro.org>
> >> Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> >> ---
> >>  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


  reply	other threads:[~2017-09-01 15:48 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01 13:08 [platforms: PATCH 00/11] Armada 70x0/80x0 SPI improvements Marcin Wojtas
2017-09-01 13:08 ` [platforms: PATCH 01/11] Platform/Marvell/Documentation: Refactor PortingGuide Marcin Wojtas
2017-09-01 14:36   ` Leif Lindholm
2017-09-01 15:08     ` Marcin Wojtas
2017-09-01 15:45       ` Leif Lindholm
2017-09-01 15:56         ` Marcin Wojtas
2017-09-01 13:08 ` [platforms: PATCH 02/11] Drivers/Spi/MvSpiDxe: Log and return correct error Marcin Wojtas
2017-09-01 14:05   ` Ard Biesheuvel
2017-09-01 13:08 ` [platforms: PATCH 03/11] Drivers/Spi/MvSpiDxe: Fix write bug Marcin Wojtas
2017-09-01 14:44   ` Leif Lindholm
2017-09-01 13:08 ` [platforms: PATCH 04/11] Applications/SpiTool: Enable configurable CS and SCLK mode Marcin Wojtas
2017-09-01 14:47   ` Leif Lindholm
2017-09-01 13:08 ` [platforms: PATCH 05/11] Platform/Marvell/Armada70x0: set CS and SCLK Mode for SPI flash Marcin Wojtas
2017-09-01 14:48   ` Leif Lindholm
2017-09-01 13:08 ` [platforms: PATCH 06/11] Applications/SpiTool: Fix bug in error test Marcin Wojtas
2017-09-01 14:48   ` Leif Lindholm
2017-09-01 13:08 ` [platforms: PATCH 07/11] Applications/FirmwareUpdate: Fix 32-bit issues Marcin Wojtas
2017-09-01 14:54   ` Leif Lindholm
2017-09-01 15:16     ` Ard Biesheuvel
2017-09-01 15:51       ` Leif Lindholm [this message]
2017-09-01 13:08 ` [platforms: PATCH 08/11] Applications/SpiTool: " Marcin Wojtas
2017-09-01 14:56   ` Leif Lindholm
2017-09-01 13:08 ` [platforms: PATCH 09/11] Drivers/Spi/Devices/MvSpiFlash: Fix usage of erase size parameter Marcin Wojtas
2017-09-01 15:21   ` Leif Lindholm
2017-09-01 15:25     ` Marcin Wojtas
2017-09-01 15:51       ` Leif Lindholm
2017-09-01 13:08 ` [platforms: PATCH 10/11] Drivers/Spi/Devices/MvSpiFlash: Enable dynamic SPI Flash detection Marcin Wojtas
2017-09-01 15:33   ` Leif Lindholm
2017-09-01 17:20     ` Marcin Wojtas
2017-09-01 22:03       ` Leif Lindholm
2017-09-01 13:08 ` [platforms: PATCH 11/11] Drivers/Spi/Devices/MvSpiFlash: Fix bank selection for Spansion Marcin Wojtas
2017-09-01 15:34   ` Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170901155108.kygqbersidnfibqf@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox