subsys/ztest: Suppress Coverity warning
Coverity warnings on dead loop code. We know this can occur if the NUM_CPUHOLD is defined as zero which occurs when CONFIG_SMP is false. Fixes #20516 Fixes #20517 Signed-off-by: David Leach <david.leach@nxp.com>
This commit is contained in:
parent
2abdc19ceb
commit
48f7f11998
1 changed files with 8 additions and 0 deletions
|
@ -135,7 +135,11 @@ void z_impl_z_test_1cpu_start(void)
|
|||
|
||||
/* Spawn N-1 threads to "hold" the other CPUs, waiting for
|
||||
* each to signal us that it's locked and spinning.
|
||||
*
|
||||
* Note that NUM_CPUHOLD can be a value that causes coverity
|
||||
* to flag the following loop as DEADCODE so suppress the warning.
|
||||
*/
|
||||
/* coverity[DEADCODE] */
|
||||
for (int i = 0; i < NUM_CPUHOLD; i++) {
|
||||
k_thread_create(&cpuhold_threads[i],
|
||||
cpuhold_stacks[i], CPUHOLD_STACK_SZ,
|
||||
|
@ -149,6 +153,10 @@ void z_impl_z_test_1cpu_stop(void)
|
|||
{
|
||||
cpuhold_active = 0;
|
||||
|
||||
/* Note that NUM_CPUHOLD can be a value that causes coverity
|
||||
* to flag the following loop as DEADCODE so suppress the warning.
|
||||
*/
|
||||
/* coverity[DEADCODE] */
|
||||
for (int i = 0; i < NUM_CPUHOLD; i++) {
|
||||
k_thread_abort(&cpuhold_threads[i]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue