Fix MTE support from causing unused variable warnings
[project/bcm63xx/atf.git] / lib / el3_runtime / aarch64 / context_mgmt.c
index a05ee5a6e4970542d6a592f0ef0a8606a2c923a1..d65e02d5e1da0505fada2e80805280e746001255 100644 (file)
@@ -142,11 +142,11 @@ void cm_setup_context(cpu_context_t *ctx, const entry_point_info_t *ep)
         * world, and only for the secure world when CTX_INCLUDE_MTE_REGS is
         * set.
         */
-       unsigned int mte = get_armv8_5_mte_support();
 #if CTX_INCLUDE_MTE_REGS
-       assert(mte == MTE_IMPLEMENTED_ELX);
+       assert(get_armv8_5_mte_support() == MTE_IMPLEMENTED_ELX);
        scr_el3 |= SCR_ATA_BIT;
 #else
+       unsigned int mte = get_armv8_5_mte_support();
        if (mte == MTE_IMPLEMENTED_EL0) {
                /*
                 * Can enable MTE across both worlds as no MTE registers are