From ee78edceca89057ab9854f7e5070391a8229ece4 Mon Sep 17 00:00:00 2001 From: Pierre Gondois Date: Fri, 23 Oct 2020 14:31:50 +0100 Subject: ArmPlatformPkg: Fix Ecc error 3002 in PL011UartLib This patch fixes the following Ecc reported error: Non-Boolean comparisons should use a compare operator (==, !=, >, < >=, <=) Signed-off-by: Pierre Gondois Reviewed-by: Ard Biesheuvel --- ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ArmPlatformPkg') diff --git a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c index f1015b1fce..3c58a0f39a 100644 --- a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c +++ b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c @@ -2,7 +2,7 @@ Serial I/O Port library functions with no library constructor/destructor Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
- Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.
+ Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -269,31 +269,31 @@ PL011UartSetControl ( { UINT32 Bits; - if (Control & (mInvalidControlBits)) { + if ((Control & mInvalidControlBits) != 0) { return RETURN_UNSUPPORTED; } Bits = MmioRead32 (UartBase + UARTCR); - if (Control & EFI_SERIAL_REQUEST_TO_SEND) { + if ((Control & EFI_SERIAL_REQUEST_TO_SEND) != 0) { Bits |= PL011_UARTCR_RTS; } else { Bits &= ~PL011_UARTCR_RTS; } - if (Control & EFI_SERIAL_DATA_TERMINAL_READY) { + if ((Control & EFI_SERIAL_DATA_TERMINAL_READY) != 0) { Bits |= PL011_UARTCR_DTR; } else { Bits &= ~PL011_UARTCR_DTR; } - if (Control & EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) { + if ((Control & EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) != 0) { Bits |= PL011_UARTCR_LBE; } else { Bits &= ~PL011_UARTCR_LBE; } - if (Control & EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE) { + if ((Control & EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE) != 0) { Bits |= (PL011_UARTCR_CTSEN | PL011_UARTCR_RTSEN); } else { Bits &= ~(PL011_UARTCR_CTSEN | PL011_UARTCR_RTSEN); -- cgit v1.2.3