]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/ArmArchTimerLib: fix unused variable in RELEASE builds
authorSami Mujawar <sami.mujawar@arm.com>
Thu, 3 Mar 2016 11:55:20 +0000 (11:55 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 1 Apr 2016 15:14:47 +0000 (17:14 +0200)
The TimerFreq variable in the TimerConstructor() is unused in RELEASE
builds since ASSERTs are then disabled.
The only use of the variable (in the ASSERT) is replaced by a direct
invocation of the function previously used to set it.

NOTE: The build tools suppress warnings of this using compiler options
eg. -Wno-unused-but-set-variable for GCC toolchain or
    --diag_suppress=550 for RVCT toolchain.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c

index 1be90c515c4de1907ac875658cac60418a39d661..e6751b29d900cdd90f00a4807fd3ace1de5c06d1 100644 (file)
@@ -42,7 +42,6 @@ TimerConstructor (
   // Check if the ARM Generic Timer Extension is implemented.\r
   //\r
   if (ArmIsArchTimerImplemented ()) {\r
-    UINTN TimerFreq;\r
 \r
     //\r
     // Check if Architectural Timer frequency is pre-determined by the platform\r
@@ -74,8 +73,8 @@ TimerConstructor (
     // mode (if secure extension is supported).\r
     // If the reset value (0) is returned, just ASSERT.\r
     //\r
-    TimerFreq = ArmGenericTimerGetTimerFreq ();\r
-    ASSERT (TimerFreq != 0);\r
+    ASSERT (ArmGenericTimerGetTimerFreq () != 0);\r
+\r
   } else {\r
     DEBUG ((EFI_D_ERROR, "ARM Architectural Timer is not available in the CPU, hence this library can not be used.\n"));\r
     ASSERT (0);\r