[edk2-devel] [PATCH v1 24/25] ArmPkg: Fix Ecc error 5007 in StandaloneMmMmuLib
PierreGondois
pierre.gondois at arm.com
Wed Dec 16 17:21:59 UTC 2020
From: Pierre Gondois <Pierre.Gondois at arm.com>
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 <Pierre.Gondois at arm.com>
---
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.<BR>
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
@@ -14,6 +14,7 @@
#include <Library/ArmMmuLib.h>
#include <Library/ArmSvcLib.h>
#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69007): https://edk2.groups.io/g/devel/message/69007
Mute This Topic: https://groups.io/mt/79006215/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list