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 <Pierre.Gondois@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
This commit is contained in:
Pierre Gondois 2020-10-23 14:31:50 +01:00 committed by mergify[bot]
parent dd917bae85
commit ee78edceca
1 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@
Serial I/O Port library functions with no library constructor/destructor Serial I/O Port library functions with no library constructor/destructor
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR> Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR> Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
@ -269,31 +269,31 @@ PL011UartSetControl (
{ {
UINT32 Bits; UINT32 Bits;
if (Control & (mInvalidControlBits)) { if ((Control & mInvalidControlBits) != 0) {
return RETURN_UNSUPPORTED; return RETURN_UNSUPPORTED;
} }
Bits = MmioRead32 (UartBase + UARTCR); Bits = MmioRead32 (UartBase + UARTCR);
if (Control & EFI_SERIAL_REQUEST_TO_SEND) { if ((Control & EFI_SERIAL_REQUEST_TO_SEND) != 0) {
Bits |= PL011_UARTCR_RTS; Bits |= PL011_UARTCR_RTS;
} else { } else {
Bits &= ~PL011_UARTCR_RTS; Bits &= ~PL011_UARTCR_RTS;
} }
if (Control & EFI_SERIAL_DATA_TERMINAL_READY) { if ((Control & EFI_SERIAL_DATA_TERMINAL_READY) != 0) {
Bits |= PL011_UARTCR_DTR; Bits |= PL011_UARTCR_DTR;
} else { } else {
Bits &= ~PL011_UARTCR_DTR; Bits &= ~PL011_UARTCR_DTR;
} }
if (Control & EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) { if ((Control & EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) != 0) {
Bits |= PL011_UARTCR_LBE; Bits |= PL011_UARTCR_LBE;
} else { } else {
Bits &= ~PL011_UARTCR_LBE; 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); Bits |= (PL011_UARTCR_CTSEN | PL011_UARTCR_RTSEN);
} else { } else {
Bits &= ~(PL011_UARTCR_CTSEN | PL011_UARTCR_RTSEN); Bits &= ~(PL011_UARTCR_CTSEN | PL011_UARTCR_RTSEN);