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:
parent
d157527ec1
commit
ca82230780
1 changed files with 8 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue