[edk2-devel] [PATCH v1 18/25] ArmPkg: Fix Ecc error 5007 in ArmCacheMaintenanceLib

PierreGondois pierre.gondois at arm.com
Wed Dec 16 17:21:53 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

 .../ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.c b/ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.c
index 440a5c372566..e14c40b3beb4 100644
--- a/ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.c
+++ b/ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.c
@@ -1,7 +1,7 @@
 /** @file

   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-  Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.
+  Copyright (c) 2011 - 2020, ARM Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -20,11 +20,14 @@ CacheRangeOperation (
   IN  UINTN           LineLength
   )
 {
-  UINTN ArmCacheLineAlignmentMask  = LineLength - 1;
-
+  UINTN ArmCacheLineAlignmentMask;
   // Align address (rounding down)
-  UINTN AlignedAddress = (UINTN)Start - ((UINTN)Start & ArmCacheLineAlignmentMask);
-  UINTN EndAddress     = (UINTN)Start + Length;
+  UINTN AlignedAddress;
+  UINTN EndAddress;
+
+  ArmCacheLineAlignmentMask = LineLength - 1;
+  AlignedAddress = (UINTN)Start - ((UINTN)Start & ArmCacheLineAlignmentMask);
+  EndAddress     = (UINTN)Start + Length;

   // Perform the line operation on an address in each cache line
   while (AlignedAddress < EndAddress) {
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69001): https://edk2.groups.io/g/devel/message/69001
Mute This Topic: https://groups.io/mt/79006208/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