Commit 019b03a3 authored by Justin Chadwell's avatar Justin Chadwell
Browse files

Fix MTE support from causing unused variable warnings



assert() calls are removed in release builds, and if that assert call is
the only use of a variable, an unused variable warning will be triggered
in a release build. This patch fixes this problem when
CTX_INCLUDE_MTE_REGS by not using an intermediate variable to store the
results of get_armv8_5_mte_support().

Change-Id: I529e10ec0b2c8650d2c3ab52c4f0cecc0b3a670e
Signed-off-by: default avatarJustin Chadwell <justin.chadwell@arm.com>
parent 6a7cbfd5
...@@ -142,11 +142,11 @@ void cm_setup_context(cpu_context_t *ctx, const entry_point_info_t *ep) ...@@ -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 * world, and only for the secure world when CTX_INCLUDE_MTE_REGS is
* set. * set.
*/ */
unsigned int mte = get_armv8_5_mte_support();
#if CTX_INCLUDE_MTE_REGS #if CTX_INCLUDE_MTE_REGS
assert(mte == MTE_IMPLEMENTED_ELX); assert(get_armv8_5_mte_support() == MTE_IMPLEMENTED_ELX);
scr_el3 |= SCR_ATA_BIT; scr_el3 |= SCR_ATA_BIT;
#else #else
unsigned int mte = get_armv8_5_mte_support();
if (mte == MTE_IMPLEMENTED_EL0) { if (mte == MTE_IMPLEMENTED_EL0) {
/* /*
* Can enable MTE across both worlds as no MTE registers are * Can enable MTE across both worlds as no MTE registers are
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment