From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E794C1A1F18 for ; Wed, 21 Sep 2016 13:33:23 -0700 (PDT) Received: from E107800.Emea.Arm.com (e107800.emea.arm.com [10.1.33.85]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id u8LKXKhd008453; Wed, 21 Sep 2016 21:33:21 +0100 From: evan.lloyd@arm.com To: edk2-devel@ml01.01.org Cc: Ard Biesheuvel , Leif Lindholm , Ryan Harkin Date: Wed, 21 Sep 2016 21:33:15 +0100 Message-Id: <20160921203315.11204-4-evan.lloyd@arm.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160921203315.11204-1-evan.lloyd@arm.com> References: <20160921203315.11204-1-evan.lloyd@arm.com> Subject: [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: Wed, 21 Sep 2016 20:33:24 -0000 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. 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")