summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library/CompilerIntrinsicsLib/memset.c
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2020-12-10 10:11:59 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-01-06 16:22:54 +0000
commit53aabb978e133d1c58fd60c693eecf836a8efe38 (patch)
treeb70c0cdb70bafccb7710d985092841b324f2fcd6 /ArmPkg/Library/CompilerIntrinsicsLib/memset.c
parente3fe63ddebfb673b01ced64ce8091b54d65ec053 (diff)
downloadedk2-53aabb978e133d1c58fd60c693eecf836a8efe38.tar.gz
edk2-53aabb978e133d1c58fd60c693eecf836a8efe38.tar.bz2
edk2-53aabb978e133d1c58fd60c693eecf836a8efe38.zip
ArmPkg: Fix Ecc error 3002 in CompilerIntrinsicsLib
This patch fixes the following Ecc reported error: Non-Boolean comparisons should use a compare operator (==, !=, >, < >=, <=) Brackets are also added to comply to with the coding standard. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Diffstat (limited to 'ArmPkg/Library/CompilerIntrinsicsLib/memset.c')
-rw-r--r--ArmPkg/Library/CompilerIntrinsicsLib/memset.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c b/ArmPkg/Library/CompilerIntrinsicsLib/memset.c
index 24398d591f..1a36aeaa56 100644
--- a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c
+++ b/ArmPkg/Library/CompilerIntrinsicsLib/memset.c
@@ -1,6 +1,7 @@
//------------------------------------------------------------------------------
//
// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
+// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
@@ -13,8 +14,9 @@ void *__memset(void *s, int c, size_t n)
{
unsigned char *d = s;
- while (n--)
+ while (n-- != 0) {
*d++ = c;
+ }
return s;
}