Browse Source

kernel: Explicitly ignoring _Swap return

Ignoring _Swap return where there is no treatment or nothing to do.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
pull/9995/head
Flavio Ceolin 7 years ago committed by Anas Nashif
parent
commit
5884c7f54b
  1. 2
      arch/arm/core/thread_abort.c
  2. 2
      arch/posix/core/posix_core.c
  3. 2
      arch/x86/core/irq_manage.c
  4. 2
      boards/posix/native_posix/irq_handler.c
  5. 2
      kernel/init.c
  6. 6
      kernel/sched.c
  7. 2
      kernel/smp.c
  8. 2
      kernel/thread.c
  9. 2
      kernel/thread_abort.c

2
arch/arm/core/thread_abort.c

@ -41,7 +41,7 @@ void _impl_k_thread_abort(k_tid_t thread) @@ -41,7 +41,7 @@ void _impl_k_thread_abort(k_tid_t thread)
if (_current == thread) {
if ((SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) == 0) {
_Swap(key);
(void)_Swap(key);
CODE_UNREACHABLE;
} else {
SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk;

2
arch/posix/core/posix_core.c

@ -511,7 +511,7 @@ void _impl_k_thread_abort(k_tid_t thread) @@ -511,7 +511,7 @@ void _impl_k_thread_abort(k_tid_t thread)
thread_idx,
__func__);
_Swap(key);
(void)_Swap(key);
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
}

2
arch/x86/core/irq_manage.c

@ -95,7 +95,7 @@ void _arch_isr_direct_footer(int swap) @@ -95,7 +95,7 @@ void _arch_isr_direct_footer(int swap)
:
: "memory"
);
_Swap(flags);
(void)_Swap(flags);
}
}

2
boards/posix/native_posix/irq_handler.c

@ -112,7 +112,7 @@ void posix_irq_handler(void) @@ -112,7 +112,7 @@ void posix_irq_handler(void)
&& (hw_irq_ctrl_get_cur_prio() == 256)
&& (_kernel.ready_q.cache != _current)) {
_Swap(irq_lock);
(void)_Swap(irq_lock);
}
}

2
kernel/init.c

@ -387,7 +387,7 @@ static void switch_to_main_thread(void) @@ -387,7 +387,7 @@ static void switch_to_main_thread(void)
* will never be rescheduled in.
*/
_Swap(irq_lock());
(void)_Swap(irq_lock());
#endif
}
#endif /* CONFIG_MULTITHREDING */

6
kernel/sched.c

@ -789,10 +789,10 @@ void _impl_k_yield(void) @@ -789,10 +789,10 @@ void _impl_k_yield(void)
}
#ifdef CONFIG_SMP
_Swap(irq_lock());
(void)_Swap(irq_lock());
#else
if (_get_next_ready_thread() != _current) {
_Swap(irq_lock());
(void)_Swap(irq_lock());
}
#endif
}
@ -827,7 +827,7 @@ void _impl_k_sleep(s32_t duration) @@ -827,7 +827,7 @@ void _impl_k_sleep(s32_t duration)
_remove_thread_from_ready_q(_current);
_add_thread_timeout(_current, NULL, ticks);
_Swap(key);
(void)_Swap(key);
#endif
}

2
kernel/smp.c

@ -86,7 +86,7 @@ static void smp_init_top(int key, void *arg) @@ -86,7 +86,7 @@ static void smp_init_top(int key, void *arg)
_arch_curr_cpu()->current = &dummy_thread;
unsigned int k = irq_lock();
smp_timer_init();
_Swap(k);
(void)_Swap(k);
CODE_UNREACHABLE;
}

2
kernel/thread.c

@ -510,7 +510,7 @@ void _impl_k_thread_suspend(struct k_thread *thread) @@ -510,7 +510,7 @@ void _impl_k_thread_suspend(struct k_thread *thread)
sys_trace_thread_suspend(thread);
if (thread == _current) {
_Swap(key);
(void)_Swap(key);
} else {
irq_unlock(key);
}

2
kernel/thread_abort.c

@ -41,7 +41,7 @@ void _impl_k_thread_abort(k_tid_t thread) @@ -41,7 +41,7 @@ void _impl_k_thread_abort(k_tid_t thread)
irq_unlock(key);
} else {
if (_current == thread) {
_Swap(key);
(void)_Swap(key);
CODE_UNREACHABLE;
}

Loading…
Cancel
Save