On Wed, Sep 21, 2016 at 09:33:15PM +0100, evan.ll...@arm.com wrote:
> From: Alexei <alexei.fedo...@arm.com>
> 
> SerialPortInitialize() set the BaudRate variable (type UINT64) as:
> BaudRate = (UINTN)FixedPcdGet64 (PcdUartDefaultBaudRate);
> 
> This commit fixes a potential problem on ARM 32-bit builds, where the
> UINTN type is defined as UINT32, by removing the cast:
> 
> BaudRate = FixedPcdGet64 (PcdUartDefaultBaudRate);
> 
> Note - a minor whitespace correction is rolled into this commit.

I can unroll it for you before committing, but I'm not going to leave
the history in a state where it looks like a FixedPcdGet8 was modified
by a commit with the title "Remove UINTN cast when setting BaudRate.".

For the fix:
Reviewed-by: Leif Lindholm <leif.lindh...@linaro.org>

Let me know how you want to deal with the whitespace change.

/
    Leif

> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Alexei Fedorov <alexei.fedo...@arm.com>
> Signed-off-by: Evan Lloyd <evan.ll...@arm.com>
> ---
>  ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c 
> b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c
> index 
> 5dce852d90f9cafb828d81dae39d03451ea608e2..4a24eded0e7d0f91270bf778cf1d89b6c809d0b2
>  100644
> --- a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c
> +++ b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c
> @@ -41,11 +41,11 @@ SerialPortInitialize (
>    UINT8               DataBits;
>    EFI_STOP_BITS_TYPE  StopBits;
>  
> -  BaudRate = (UINTN)FixedPcdGet64 (PcdUartDefaultBaudRate);
> +  BaudRate = FixedPcdGet64 (PcdUartDefaultBaudRate);
>    ReceiveFifoDepth = 0;         // Use default FIFO depth
>    Parity = (EFI_PARITY_TYPE)FixedPcdGet8 (PcdUartDefaultParity);
>    DataBits = FixedPcdGet8 (PcdUartDefaultDataBits);
> -  StopBits = (EFI_STOP_BITS_TYPE) FixedPcdGet8 (PcdUartDefaultStopBits);
> +  StopBits = (EFI_STOP_BITS_TYPE)FixedPcdGet8 (PcdUartDefaultStopBits);
>  
>    return PL011UartInitializePort (
>             (UINTN)FixedPcdGet64 (PcdSerialRegisterBase),
> -- 
> Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to