From 26a520b2befb310b9ee23da108854c9d9c294c11 Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Wed, 29 Jan 2025 09:38:45 +0000 Subject: [PATCH] fix(tc): fix compilation error When the SPD_spmd configuration is disabled, the compiler complaints: plat/arm/board/tc/tc_bl2_dpe.c:234:22: error: unused variable 'array_size' [-Werror=unused-variable] 234 | const size_t array_size = ARRAY_SIZE(tc_dpe_metadata); | ^~~~~~~~~~ plat/arm/board/tc/tc_bl2_dpe.c:233:16: error: unused variable 'i' [-Werror=unused-variable] 233 | size_t i; | ^ cc1: all warnings being treated as errors Move variable declarations into the code chunk protected by the SPD_spmd configuration. Change-Id: I1a3889938e2d4ec5efec516e9ef54034f9d711b2 Signed-off-by: Leo Yan --- plat/arm/board/tc/tc_bl2_dpe.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plat/arm/board/tc/tc_bl2_dpe.c b/plat/arm/board/tc/tc_bl2_dpe.c index 144e898ea..94fddd4f1 100644 --- a/plat/arm/board/tc/tc_bl2_dpe.c +++ b/plat/arm/board/tc/tc_bl2_dpe.c @@ -230,14 +230,10 @@ void plat_dpe_get_context_handle(int *ctx_handle) void bl2_plat_mboot_init(void) { +#if defined(SPD_spmd) size_t i; const size_t array_size = ARRAY_SIZE(tc_dpe_metadata); - /* Initialize the communication channel between AP and RSE */ - (void)rse_comms_init(PLAT_RSE_AP_SND_MHU_BASE, - PLAT_RSE_AP_RCV_MHU_BASE); - -#if defined(SPD_spmd) for (i = 0U; i < array_size; i++) { if (tc_dpe_metadata[i].id != SP_PKG1_ID) { continue; @@ -257,6 +253,10 @@ void bl2_plat_mboot_init(void) } #endif + /* Initialize the communication channel between AP and RSE */ + (void)rse_comms_init(PLAT_RSE_AP_SND_MHU_BASE, + PLAT_RSE_AP_RCV_MHU_BASE); + dpe_init(tc_dpe_metadata); }