On Fri, Sep 01, 2017 at 03:08:19PM +0200, Marcin Wojtas wrote:
> From: Ard Biesheuvel <[email protected]>
> 
> 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 <[email protected]>
> Signed-off-by: Marcin Wojtas <[email protected]>
> ---
>  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
> 
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to