tests/kernel/fp_sharing: Fix static analysis warning

Can't use a volatile variable in something that the tool thinks is an
optional assert, because the read is treated as a side effect.

Fixes #18438
Fixes #18439

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2019-08-21 16:30:32 -07:00 committed by Anas Nashif
commit ca82230780

View file

@ -139,7 +139,10 @@ void test_k_float_disable_syscall(void)
"usr_fp_thread FP options not clear (0x%0x)",
usr_fp_thread.base.user_options);
zassert_true(ret == TC_PASS, "");
/* ret is volatile, static analysis says we can't use in assert */
bool ok = ret == TC_PASS;
zassert_true(ok, "");
#else
/* Check skipped for x86 without support for Lazy FP Sharing */
#endif
@ -237,7 +240,10 @@ void test_k_float_disable_irq(void)
/* Yield will swap-in sup_fp_thread */
k_yield();
zassert_true(ret == TC_PASS, "");
/* ret is volatile, static analysis says we can't use in assert */
bool ok = ret == TC_PASS;
zassert_true(ok, "");
}
#else
void test_k_float_disable_irq(void)