]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Fix Ecc error 5007 in ArmLib
authorPierre Gondois <Pierre.Gondois@arm.com>
Thu, 10 Dec 2020 13:12:00 +0000 (13:12 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 6 Jan 2021 16:22:54 +0000 (16:22 +0000)
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>
ArmPkg/Library/ArmLib/ArmLib.c

index 3905d02c5e7e27e387b78038c277c7e9dd35bf86..c8622f1794e01d0d717fe2abd50f3662bdebdfc7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 \r
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-  Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2021, ARM Ltd. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -19,9 +19,7 @@ ArmSetAuxCrBit (
   IN  UINT32    Bits\r
   )\r
 {\r
-  UINT32 val = ArmReadAuxCr();\r
-  val |= Bits;\r
-  ArmWriteAuxCr(val);\r
+  ArmWriteAuxCr(ArmReadAuxCr() | Bits);\r
 }\r
 \r
 VOID\r
@@ -30,9 +28,7 @@ ArmUnsetAuxCrBit (
   IN  UINT32    Bits\r
   )\r
 {\r
-  UINT32 val = ArmReadAuxCr();\r
-  val &= ~Bits;\r
-  ArmWriteAuxCr(val);\r
+  ArmWriteAuxCr(ArmReadAuxCr() & ~Bits);\r
 }\r
 \r
 //\r
@@ -45,10 +41,7 @@ ArmSetCpuActlrBit (
   IN  UINTN    Bits\r
   )\r
 {\r
-  UINTN Value;\r
-  Value =  ArmReadCpuActlr ();\r
-  Value |= Bits;\r
-  ArmWriteCpuActlr (Value);\r
+  ArmWriteCpuActlr (ArmReadCpuActlr () | Bits);\r
 }\r
 \r
 VOID\r
@@ -57,10 +50,7 @@ ArmUnsetCpuActlrBit (
   IN  UINTN    Bits\r
   )\r
 {\r
-  UINTN Value;\r
-  Value = ArmReadCpuActlr ();\r
-  Value &= ~Bits;\r
-  ArmWriteCpuActlr (Value);\r
+  ArmWriteCpuActlr (ArmReadCpuActlr () & ~Bits);\r
 }\r
 \r
 UINTN\r