From 0931171f54b2f357623d932fe1a987325d9c2077 Mon Sep 17 00:00:00 2001 From: Pierre Gondois Date: Thu, 10 Dec 2020 13:14:49 +0000 Subject: ArmPkg: Fix Ecc error 5007 in StandaloneMmMmuLib 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 Reviewed-by: Ard Biesheuvel --- .../StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ArmPkg') diff --git a/ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib.c b/ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib.c index 3806490f70..5a316bc256 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 - 2021, 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; -- cgit v1.2.3