From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (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 8EAFC1A1E6B for ; Mon, 10 Oct 2016 12:04:42 -0700 (PDT) Received: by mail-qk0-x234.google.com with SMTP id z190so114956367qkc.2 for ; Mon, 10 Oct 2016 12:04:42 -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=UHtKoWBBis6/Tcx47HrQYxjztICGN40+i8lRuTeHrCg=; b=kp97IapBTfAncouXq715czHSNyT+jJIoI0bM4gIarhrh5kCv5euMJEH+o0kOT3xg4u CTMkBwIi0XJ/3D13CNQ+zeRmR8I1/14dnPK4BbL4d7qP2bFL9EpKnsdvyxPu3D85IHB9 IUaA87hSHpdLtjnvxGOktXK3T8C3tRTai1b2s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UHtKoWBBis6/Tcx47HrQYxjztICGN40+i8lRuTeHrCg=; b=b/BBz5ezC0/BddD0nb0RZGvkGlrxd8cZH5ogi7oClBp32CmdG+8gN7Lbukl3or79bY YEAlU/DD49MvaEJDgoCV4WxS/fLvarVedbW+GBQplD7UBmSGf76pdv/WCq8Gx4V5C7P+ 1+dMVoa5e9TdykK5Rum6lJX8bvNebC/zG4z54g8nvNnR1Ey2EmVUHWai97uXiHWnmyE7 3nQZUlBrx/vnXzOKU/dvV7TjqLk8F5bpD0TYOfL8xWBspXg1oPkcHyOsf3IAIQ9T0EXc FRufaIS6+t4zLwsPVXypjPAjPWisBzsNZGbikaE0+c+cZCkaLA+qT22L0rZGly4rJf2V EMeA== X-Gm-Message-State: AA6/9RkxRJplHPw5T4+4FJUTy4q+dZW1jPk4R6wkuUmqHEMqoNBrm0S7pLLfq1P9yeHKWkFU X-Received: by 10.194.64.36 with SMTP id l4mr36318452wjs.163.1476126281488; Mon, 10 Oct 2016 12:04:41 -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 p3sm42192034wjr.31.2016.10.10.12.04.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Oct 2016 12:04:40 -0700 (PDT) Date: Mon, 10 Oct 2016 20:04:39 +0100 From: Leif Lindholm To: evan.lloyd@arm.com Cc: edk2-devel@ml01.01.org, Ard Biesheuvel , Ryan Harkin Message-ID: <20161010190438.GN3471@bivouac.eciton.net> References: <20160921203315.11204-1-evan.lloyd@arm.com> <20160921203315.11204-4-evan.lloyd@arm.com> MIME-Version: 1.0 In-Reply-To: <20160921203315.11204-4-evan.lloyd@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH 3/3] ArmPlatformPkg: Remove UINTN cast when setting BaudRate. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 19:04:42 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Sep 21, 2016 at 09:33:15PM +0100, evan.lloyd@arm.com wrote: > From: Alexei > > 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 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 > Signed-off-by: Evan Lloyd > --- > 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") >