Skip to content

Commit 9ca5e2b

Browse files
committed
platform: stm: remove gtzc_periph_att when unused
Combine the #ifdef clauses of the gtzc_periph_att usages to only instantiate the variable when it is actually used. This fixes the -Wunused-variable warning: /platform/ext/target/stm/common/stm32h5xx/secure/target_cfg.c:480:12: warning: unused variable 'gtzc_periph_att' [-Wunused-variable] 480 | uint32_t gtzc_periph_att; | ^~~~~~~~~~~~~~~ Change-Id: I04e4eebedf791e76f943557633338c115164e410 Signed-off-by: Stefan Gloor <[email protected]> (cherry picked from commit c91f4e60f112e3f63aa35f197f00112e0d43cd7f) Signed-off-by: Tim Pambor <[email protected]>
1 parent 8272b8d commit 9ca5e2b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

platform/ext/target/stm/common/stm32h5xx/secure/target_cfg.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,17 @@ static void gtzc_internal_flash_priv(uint32_t offset_start, uint32_t offset_end)
477477

478478
void gtzc_init_cfg(void)
479479
{
480+
#if (defined (MBEDTLS_SHA256_C) && defined (MBEDTLS_SHA256_ALT)) \
481+
|| (defined (MBEDTLS_SHA1_C) && defined (MBEDTLS_SHA1_ALT)) \
482+
|| (defined (MBEDTLS_MD5_C) && defined (MBEDTLS_MD5_ALT)) \
483+
|| (defined (MBEDTLS_ECP_C) && defined (MBEDTLS_ECP_ALT)) \
484+
|| (defined (MBEDTLS_ECDSA_C) && (defined (MBEDTLS_ECDSA_SIGN_ALT) || defined (MBEDTLS_ECDSA_VERIFY_ALT))) \
485+
|| (defined (MBEDTLS_AES_C) && defined (MBEDTLS_AES_ALT)) \
486+
|| (defined (MBEDTLS_GCM_C) && defined (MBEDTLS_GCM_ALT)) \
487+
|| (defined (MBEDTLS_CCM_C) && defined (MBEDTLS_CCM_ALT)) \
488+
|| defined (HW_CRYPTO_DPA_AES) || defined (HW_CRYPTO_DPA_GCM)
480489
uint32_t gtzc_periph_att;
490+
#endif
481491

482492
if (uFlowStage == FLOW_STAGE_CFG)
483493
{

0 commit comments

Comments
 (0)