mirror of https://github.com/acidanthera/audk.git
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:
parent
dd917bae85
commit
ee78edceca
|
@ -2,7 +2,7 @@
|
|||
Serial I/O Port library functions with no library constructor/destructor
|
||||
|
||||
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
|
||||
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue