summaryrefslogtreecommitdiffstats
path: root/ArmPkg
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2020-12-10 10:38:26 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-01-06 16:22:54 +0000
commitf66c2b32cc1b0992def1923dd9ad9c3e4678e102 (patch)
treec8f6a3f6c97b2ebfee2c0a1f0ba3dcb5b5d04a61 /ArmPkg
parenta387f2ee2e466905b19745bbe047c1c0ab399086 (diff)
downloadedk2-f66c2b32cc1b0992def1923dd9ad9c3e4678e102.tar.gz
edk2-f66c2b32cc1b0992def1923dd9ad9c3e4678e102.tar.bz2
edk2-f66c2b32cc1b0992def1923dd9ad9c3e4678e102.zip
ArmPkg: Fix Ecc error 3002 in SemihostFs
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 'ArmPkg')
-rw-r--r--ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
index a66bcb1369..69e983226b 100644
--- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
+++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
@@ -2,7 +2,7 @@
Support a Semi Host file system over a debuggers JTAG
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
- Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
+ Portions copyright (c) 2011 - 2021, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -196,8 +196,8 @@ FileOpen (
return EFI_INVALID_PARAMETER;
}
- if ((OpenMode & EFI_FILE_MODE_CREATE) &&
- (Attributes & EFI_FILE_DIRECTORY) ) {
+ if (((OpenMode & EFI_FILE_MODE_CREATE) != 0) &&
+ ((Attributes & EFI_FILE_DIRECTORY) != 0)) {
return EFI_WRITE_PROTECTED;
}
@@ -234,7 +234,7 @@ FileOpen (
Return = SemihostFileOpen (AsciiFileName, SemihostMode, &SemihostHandle);
if (RETURN_ERROR (Return)) {
- if (OpenMode & EFI_FILE_MODE_CREATE) {
+ if ((OpenMode & EFI_FILE_MODE_CREATE) != 0) {
//
// In the create if does not exist case, if the opening in update
// mode failed, create it and open it in update mode. The update
@@ -277,7 +277,8 @@ FileOpen (
FileFcb->Info.FileSize = Length;
FileFcb->Info.PhysicalSize = Length;
- FileFcb->Info.Attribute = (OpenMode & EFI_FILE_MODE_CREATE) ? Attributes : 0;
+ FileFcb->Info.Attribute = ((OpenMode & EFI_FILE_MODE_CREATE) != 0) ?
+ Attributes : 0;
InsertTailList (&gFileList, &FileFcb->Link);