From 5884c7f54bee623ed70544164562d02cbf881b4e Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Tue, 11 Sep 2018 18:45:27 -0700 Subject: [PATCH] kernel: Explicitly ignoring _Swap return Ignoring _Swap return where there is no treatment or nothing to do. Signed-off-by: Flavio Ceolin --- arch/arm/core/thread_abort.c | 2 +- arch/posix/core/posix_core.c | 2 +- arch/x86/core/irq_manage.c | 2 +- boards/posix/native_posix/irq_handler.c | 2 +- kernel/init.c | 2 +- kernel/sched.c | 6 +++--- kernel/smp.c | 2 +- kernel/thread.c | 2 +- kernel/thread_abort.c | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/arm/core/thread_abort.c b/arch/arm/core/thread_abort.c index 1e54c76c786..605a5795c73 100644 --- a/arch/arm/core/thread_abort.c +++ b/arch/arm/core/thread_abort.c @@ -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; diff --git a/arch/posix/core/posix_core.c b/arch/posix/core/posix_core.c index 3f29743d14e..fa5db874bf9 100644 --- a/arch/posix/core/posix_core.c +++ b/arch/posix/core/posix_core.c @@ -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 */ } diff --git a/arch/x86/core/irq_manage.c b/arch/x86/core/irq_manage.c index a1d8833b145..9281920c0b6 100644 --- a/arch/x86/core/irq_manage.c +++ b/arch/x86/core/irq_manage.c @@ -95,7 +95,7 @@ void _arch_isr_direct_footer(int swap) : : "memory" ); - _Swap(flags); + (void)_Swap(flags); } } diff --git a/boards/posix/native_posix/irq_handler.c b/boards/posix/native_posix/irq_handler.c index 07e4c2fde62..677a71e9796 100644 --- a/boards/posix/native_posix/irq_handler.c +++ b/boards/posix/native_posix/irq_handler.c @@ -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); } } diff --git a/kernel/init.c b/kernel/init.c index 127101d2536..fcc1fcc4422 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -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 */ diff --git a/kernel/sched.c b/kernel/sched.c index f91dfe38eb1..f014cedba45 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -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) _remove_thread_from_ready_q(_current); _add_thread_timeout(_current, NULL, ticks); - _Swap(key); + (void)_Swap(key); #endif } diff --git a/kernel/smp.c b/kernel/smp.c index 0b1abc6b9eb..b32dfdaf23b 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -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; } diff --git a/kernel/thread.c b/kernel/thread.c index 13e4ac17b75..88aba367b37 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -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); } diff --git a/kernel/thread_abort.c b/kernel/thread_abort.c index e3cc872ae40..39d33dc59fd 100644 --- a/kernel/thread_abort.c +++ b/kernel/thread_abort.c @@ -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; }