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.72.1608139370171385607 for ; Wed, 16 Dec 2020 09:22:50 -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 E0A231FB; Wed, 16 Dec 2020 09:22:49 -0800 (PST) Received: from e120189.arm.com (unknown [10.57.25.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 88BB73F66E; Wed, 16 Dec 2020 09:22:48 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io, ard.biesheuvel@arm.com, leif@nuviainc.com Cc: sami.mujawar@arm.com Subject: [PATCH v1 20/25] ArmPkg: Fix Ecc error 5007 in ArmLib Date: Wed, 16 Dec 2020 17:21:55 +0000 Message-Id: <20201216172200.25846-21-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 ArmPkg/Library/ArmLib/ArmLib.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/ArmPkg/Library/ArmLib/ArmLib.c b/ArmPkg/Library/ArmLib/ArmLib.c index 3905d02c5e7e..c454ce5b99ad 100644 --- a/ArmPkg/Library/ArmLib/ArmLib.c +++ b/ArmPkg/Library/ArmLib/ArmLib.c @@ -1,7 +1,7 @@ /** @file Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.
+ Copyright (c) 2011 - 2020, ARM Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -19,9 +19,7 @@ ArmSetAuxCrBit ( IN UINT32 Bits ) { - UINT32 val = ArmReadAuxCr(); - val |= Bits; - ArmWriteAuxCr(val); + ArmWriteAuxCr(ArmReadAuxCr() | Bits); } VOID @@ -30,9 +28,7 @@ ArmUnsetAuxCrBit ( IN UINT32 Bits ) { - UINT32 val = ArmReadAuxCr(); - val &= ~Bits; - ArmWriteAuxCr(val); + ArmWriteAuxCr(ArmReadAuxCr() & ~Bits); } // @@ -45,10 +41,7 @@ ArmSetCpuActlrBit ( IN UINTN Bits ) { - UINTN Value; - Value = ArmReadCpuActlr (); - Value |= Bits; - ArmWriteCpuActlr (Value); + ArmWriteCpuActlr (ArmReadCpuActlr () | Bits); } VOID @@ -57,10 +50,7 @@ ArmUnsetCpuActlrBit ( IN UINTN Bits ) { - UINTN Value; - Value = ArmReadCpuActlr (); - Value &= ~Bits; - ArmWriteCpuActlr (Value); + ArmWriteCpuActlr (ArmReadCpuActlr () & ~Bits); } UINTN -- 2.17.1