Tegra: Fix up INFO() message
authorSandrine Bailleux <sandrine.bailleux@arm.com>
Thu, 21 Jun 2018 09:41:43 +0000 (11:41 +0200)
committerSandrine Bailleux <sandrine.bailleux@arm.com>
Fri, 13 Jul 2018 09:31:17 +0000 (11:31 +0200)
With commit cf24229e6ef4 ("Run compiler on debug macros for type
checking"), the compiler will now always evaluate INFO() macro
calls, no matter the LOG_LEVEL value. Therefore, any variable
referenced in the macro has to be be defined.

Address this issue by removing the local variable and using the
expression it was assigned directly in the INFO() call.

Change-Id: Iedc23b3538c1e162372e85390881e50718e50bf3
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
plat/nvidia/tegra/common/tegra_bl31_setup.c

index 2fe4e7dbc5b6190dc56e58c5b9e35be210c98b23..f0a7036efede6f3522ad35350136268540f243c3 100644 (file)
@@ -116,9 +116,6 @@ void bl31_early_platform_setup(bl31_params_t *from_bl2,
 {
        plat_params_from_bl2_t *plat_params =
                (plat_params_from_bl2_t *)plat_params_from_bl2;
-#if LOG_LEVEL >= LOG_LEVEL_INFO
-       int impl = (read_midr() >> MIDR_IMPL_SHIFT) & MIDR_IMPL_MASK;
-#endif
        image_info_t bl32_img_info = { {0} };
        uint64_t tzdram_start, tzdram_end, bl32_start, bl32_end;
 
@@ -227,8 +224,9 @@ void bl31_early_platform_setup(bl31_params_t *from_bl2,
        /* Early platform setup for Tegra SoCs */
        plat_early_platform_setup();
 
-       INFO("BL3-1: Boot CPU: %s Processor [%lx]\n", (impl == DENVER_IMPL) ?
-               "Denver" : "ARM", read_mpidr());
+       INFO("BL3-1: Boot CPU: %s Processor [%lx]\n",
+            (((read_midr() >> MIDR_IMPL_SHIFT) & MIDR_IMPL_MASK)
+             == DENVER_IMPL) ? "Denver" : "ARM", read_mpidr());
 }
 
 #ifdef SPD_trusty