From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.882.1607019602830343836 for ; Thu, 03 Dec 2020 10:20:02 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6E8DE11D4; Thu, 3 Dec 2020 10:20:02 -0800 (PST) Received: from e120189.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5E45B3F575; Thu, 3 Dec 2020 10:20:01 -0800 (PST) From: "PierreGondois" To: leif@nuviainc.com, ard.biesheuvel@arm.com, thomas.abraham@arm.com, devel@edk2.groups.io Cc: sami.mujawar@arm.com Subject: [PATCH v1 02/16] ArmPlatformPkg: Fix Ecc error 3002 in PL011UartLib Date: Thu, 3 Dec 2020 18:19:31 +0000 Message-Id: <20201203181945.10880-3-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201203181945.10880-1-Pierre.Gondois@arm.com> References: <20201203181945.10880-1-Pierre.Gondois@arm.com> From: Pierre Gondois This patch fixes the following Ecc reported error: Non-Boolean comparisons should use a compare operator (==, !=, >, < >=, <=) Signed-off-by: Pierre Gondois --- The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1 ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c index f1015b1fce33a8188915b3bbeda81c2c37e35cb0..3c58a0f39acb3867048f46c25ec1d41930a2b2ee 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); -- 2.17.1