From: "PierreGondois" <pierre.gondois@arm.com>
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 [thread overview]
Message-ID: <20201203181945.10880-3-Pierre.Gondois@arm.com> (raw)
In-Reply-To: <20201203181945.10880-1-Pierre.Gondois@arm.com>
From: Pierre Gondois <Pierre.Gondois@arm.com>
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>
---
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.<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);
--
2.17.1
next prev parent reply other threads:[~2020-12-03 18:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
2020-12-03 18:19 ` [PATCH v1 01/16] ArmPlatformPkg: Fix Ecc error 3001 in NorFlashDxe PierreGondois
2020-12-03 18:19 ` PierreGondois [this message]
2020-12-03 18:19 ` [PATCH v1 03/16] ArmPlatformPkg: Fix Ecc error 3002 in PL061GpioDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 04/16] ArmPlatformPkg: Fix Ecc error 5007 in LcdGraphicsOutputDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 05/16] ArmPlatformPkg: Fix Ecc error 5007 in NorFlashDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 06/16] ArmPlatformPkg: Fix Ecc error 5007 in PL061GpioDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 07/16] ArmPlatformPkg: Fix Ecc error 5007 in PL031RealTimeClockLib PierreGondois
2020-12-03 18:19 ` [PATCH v1 08/16] ArmPlatformPkg: Fix Ecc error 10016 in PrePi PierreGondois
2020-12-03 18:19 ` [PATCH v1 09/16] ArmPlatformPkg: Fix Ecc error 10016 in LcdPlatformNullLib PierreGondois
2020-12-03 18:19 ` [PATCH v1 10/16] ArmPlatformPkg: Fix Ecc error 10014 in LcdGraphicsOutputDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 11/16] ArmPlatformPkg: Fix Ecc error 10014 in PL061GpioDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 12/16] ArmPlatformPkg: Fix Ecc error 10014 in SP805WatchdogDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 13/16] ArmPlatformPkg: Fix Ecc error 10006 in ArmPlatformPkg.dsc PierreGondois
2020-12-03 18:19 ` [PATCH v1 14/16] ArmPlatformPkg: Fix Ecc error 8001 in PrePi PierreGondois
2020-12-03 18:19 ` [PATCH v1 15/16] ArmPlatformPkg: Fix Ecc error 8005 PierreGondois
2020-12-09 15:09 ` Ard Biesheuvel
2020-12-03 18:19 ` [PATCH v1 16/16] ArmPlatformPkg: Fix cspell reported spelling/wording PierreGondois
2020-12-09 15:33 ` [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201203181945.10880-3-Pierre.Gondois@arm.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox