public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: evan.lloyd@arm.com
Cc: edk2-devel@ml01.01.org,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Ryan Harkin <ryan.harkin@linaro.org>
Subject: Re: [PATCH 3/3] ArmPlatformPkg: Remove UINTN cast when setting BaudRate.
Date: Mon, 10 Oct 2016 20:04:39 +0100	[thread overview]
Message-ID: <20161010190438.GN3471@bivouac.eciton.net> (raw)
In-Reply-To: <20160921203315.11204-4-evan.lloyd@arm.com>


On Wed, Sep 21, 2016 at 09:33:15PM +0100, evan.lloyd@arm.com wrote:
> From: Alexei <Alexei.Fedorov@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.lindholm@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.fedorov@arm.com>
> Signed-off-by: Evan Lloyd <evan.lloyd@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")
> 


  reply	other threads:[~2016-10-10 19:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 20:33 [PATCH 0/3] PL011 updates evan.lloyd
2016-09-21 20:33 ` [PATCH 1/3] ArmPlatformPkg: Fix PL011 FIFO size test evan.lloyd
2016-10-10 18:58   ` Leif Lindholm
2016-09-21 20:33 ` [PATCH 2/3] ArmPlatformPkg: Correct mendacious comments evan.lloyd
2016-10-10 19:00   ` Leif Lindholm
2016-09-21 20:33 ` [PATCH 3/3] ArmPlatformPkg: Remove UINTN cast when setting BaudRate evan.lloyd
2016-10-10 19:04   ` Leif Lindholm [this message]
2016-10-11 10:23     ` Evan Lloyd
2016-10-11 11:27       ` Leif Lindholm
2016-10-11 12:29         ` Evan Lloyd
2016-10-11 11:34       ` Laszlo Ersek
2016-10-12  7:30 ` [PATCH 0/3] PL011 updates Ryan Harkin

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=20161010190438.GN3471@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