summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2020-10-23 14:31:50 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-12-09 15:32:12 +0000
commitee78edceca89057ab9854f7e5070391a8229ece4 (patch)
tree15f9d589197668d13a89f51486a6d41f4852ae6b /ArmPlatformPkg
parentdd917bae85396055ff5d6ea760bff3702d154101 (diff)
downloadedk2-ee78edceca89057ab9854f7e5070391a8229ece4.tar.gz
edk2-ee78edceca89057ab9854f7e5070391a8229ece4.tar.bz2
edk2-ee78edceca89057ab9854f7e5070391a8229ece4.zip
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>
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r--ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c12
1 files changed, 6 insertions, 6 deletions
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.<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);