diff options
author | Pierre Gondois <Pierre.Gondois@arm.com> | 2020-10-23 14:32:40 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-12-09 15:32:12 +0000 |
commit | d315bd2286cde306f1ef5256026038e610505cca (patch) | |
tree | 6f90a66eeeb8f174fd820372c511dde0fe205a57 | |
parent | ee78edceca89057ab9854f7e5070391a8229ece4 (diff) | |
download | edk2-d315bd2286cde306f1ef5256026038e610505cca.tar.gz edk2-d315bd2286cde306f1ef5256026038e610505cca.tar.bz2 edk2-d315bd2286cde306f1ef5256026038e610505cca.zip |
ArmPlatformPkg: Fix Ecc error 3002 in PL061GpioDxe
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>
-rw-r--r-- | ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c index 778bd6858f..020d8c9fd9 100644 --- a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c +++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c @@ -1,6 +1,6 @@ /** @file
*
-* Copyright (c) 2011, ARM Limited. All rights reserved.
+* Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
* Copyright (c) 2016, Linaro Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -181,7 +181,7 @@ Get ( return EFI_INVALID_PARAMETER;
}
- if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset))) {
+ if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset)) != 0) {
*Value = 1;
} else {
*Value = 0;
@@ -292,7 +292,7 @@ GetMode ( // Check if it is input or output
if (MmioRead8 (RegisterBase + PL061_GPIO_DIR_REG) & GPIO_PIN_MASK(Offset)) {
// Pin set to output
- if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset))) {
+ if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset)) != 0) {
*Mode = GPIO_MODE_OUTPUT_1;
} else {
*Mode = GPIO_MODE_OUTPUT_0;
|