diff options
author | Pierre Gondois <Pierre.Gondois@arm.com> | 2020-12-10 13:10:05 +0000 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-01-06 16:22:54 +0000 |
commit | 15f5b04e435197318257269ff2b1ee8c212528ef (patch) | |
tree | 5e57ee17ce41c00ed84a95a11d8773a3da0898d3 /ArmPkg/Library | |
parent | 88a7d4aa30a42e1fee8c6eb6972bb1a9260103fc (diff) | |
download | edk2-15f5b04e435197318257269ff2b1ee8c212528ef.tar.gz edk2-15f5b04e435197318257269ff2b1ee8c212528ef.tar.bz2 edk2-15f5b04e435197318257269ff2b1ee8c212528ef.zip |
ArmPkg: Fix Ecc error 5007 in ArmCacheMaintenanceLib
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@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Diffstat (limited to 'ArmPkg/Library')
-rw-r--r-- | ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.c b/ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.c index 440a5c3725..db9290f275 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 - 2021, 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) {
|