From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.76.1608139376113031139 for ; Wed, 16 Dec 2020 09:22:56 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D1B061FB; Wed, 16 Dec 2020 09:22:55 -0800 (PST) Received: from e120189.arm.com (unknown [10.57.25.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7DABB3F66E; Wed, 16 Dec 2020 09:22:54 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io, ard.biesheuvel@arm.com, leif@nuviainc.com Cc: sami.mujawar@arm.com Subject: [PATCH v1 24/25] ArmPkg: Fix Ecc error 5007 in StandaloneMmMmuLib Date: Wed, 16 Dec 2020 17:21:59 +0000 Message-Id: <20201216172200.25846-25-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201216172200.25846-1-Pierre.Gondois@arm.com> References: <20201216172200.25846-1-Pierre.Gondois@arm.com> From: Pierre Gondois This patch fixes the following Ecc reported error: There should be no initialization of a variable as part of its declaration Signed-off-by: Pierre Gondois --- The changes can be seen at: https://github.com/PierreARM/edk2/commits/1552_Ecc_ArmPkg_v1 .../AArch64/ArmMmuStandaloneMmLib.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib.c b/ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib.c index 3806490f7006..0b64e3384e6d 100644 --- a/ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib.c +++ b/ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib.c @@ -1,7 +1,7 @@ /** @file * File managing the MMU for ARMv8 architecture in S-EL0 * -* Copyright (c) 2017 - 2018, ARM Limited. All rights reserved. +* Copyright (c) 2017 - 2020, Arm Limited. All rights reserved.
* * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -14,6 +14,7 @@ #include #include #include +#include #include STATIC @@ -23,12 +24,12 @@ GetMemoryPermissions ( OUT UINT32 *MemoryAttributes ) { - ARM_SVC_ARGS GetMemoryPermissionsSvcArgs = {0}; + ARM_SVC_ARGS GetMemoryPermissionsSvcArgs; + + ZeroMem (&GetMemoryPermissionsSvcArgs, sizeof (ARM_SVC_ARGS)); GetMemoryPermissionsSvcArgs.Arg0 = ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64; GetMemoryPermissionsSvcArgs.Arg1 = BaseAddress; - GetMemoryPermissionsSvcArgs.Arg2 = 0; - GetMemoryPermissionsSvcArgs.Arg3 = 0; ArmCallSvc (&GetMemoryPermissionsSvcArgs); if (GetMemoryPermissionsSvcArgs.Arg0 == ARM_SVC_SPM_RET_INVALID_PARAMS) { @@ -49,7 +50,9 @@ RequestMemoryPermissionChange ( ) { EFI_STATUS Status; - ARM_SVC_ARGS ChangeMemoryPermissionsSvcArgs = {0}; + ARM_SVC_ARGS ChangeMemoryPermissionsSvcArgs; + + ZeroMem (&ChangeMemoryPermissionsSvcArgs, sizeof (ARM_SVC_ARGS)); ChangeMemoryPermissionsSvcArgs.Arg0 = ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64; ChangeMemoryPermissionsSvcArgs.Arg1 = BaseAddress; -- 2.17.1