summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.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_ms.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_ms.c')
-rw-r--r--ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c b/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c
index 4de55d8457..c046b8be86 100644
--- a/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c
+++ b/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c
@@ -1,6 +1,7 @@
//------------------------------------------------------------------------------
//
// Copyright (c) 2017, Pete Batard. All rights reserved.<BR>
+// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
@@ -19,8 +20,9 @@ void *memset(void *s, int c, size_t n)
{
unsigned char *d = s;
- while (n--)
+ while (n-- != 0) {
*d++ = (unsigned char)c;
+ }
return s;
}