kernel: Fix unused-parameter warnings
Add missing ARG_UNUSED where needed.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
diff --git a/kernel/queue.c b/kernel/queue.c
index 0743597..7e6102e 100644
--- a/kernel/queue.c
+++ b/kernel/queue.c
@@ -88,6 +88,9 @@
{
#ifdef CONFIG_POLL
z_handle_obj_poll_events(&queue->poll_events, state);
+#else
+ ARG_UNUSED(queue);
+ ARG_UNUSED(state);
#endif
}
diff --git a/kernel/sched.c b/kernel/sched.c
index f668c18..0288276 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -77,6 +77,7 @@
return (thread->base.prio - K_HIGHEST_THREAD_PRIO)
< CONFIG_NUM_METAIRQ_PRIORITIES;
#else
+ ARG_UNUSED(thread);
return 0;
#endif
}
@@ -219,6 +220,7 @@
return &_kernel.cpus[cpu].ready_q.runq;
#else
+ ARG_UNUSED(thread);
return &_kernel.ready_q.runq;
#endif
}
@@ -443,6 +445,8 @@
if (thread->base.slice_ticks != 0) {
ret = thread->base.slice_ticks;
}
+#else
+ ARG_UNUSED(thread);
#endif
return ret;
}
@@ -558,6 +562,8 @@
/* Returning from existing preemption */
_current_cpu->metairq_preempted = NULL;
}
+#else
+ ARG_UNUSED(thread);
#endif
}
@@ -607,6 +613,7 @@
}
}
#endif
+ ARG_UNUSED(thread);
return false;
}
@@ -1153,6 +1160,8 @@
void z_priq_dumb_remove(sys_dlist_t *pq, struct k_thread *thread)
{
+ ARG_UNUSED(pq);
+
__ASSERT_NO_MSG(!z_is_idle_thread_object(thread));
sys_dlist_remove(&thread->base.qnode_dlist);
diff --git a/kernel/thread.c b/kernel/thread.c
index 4f330b6..49b97e6 100644
--- a/kernel/thread.c
+++ b/kernel/thread.c
@@ -69,6 +69,9 @@
SYS_PORT_TRACING_FUNC_EXIT(k_thread, foreach);
k_spin_unlock(&z_thread_monitor_lock, key);
+#else
+ ARG_UNUSED(user_cb);
+ ARG_UNUSED(user_data);
#endif
}
@@ -93,6 +96,9 @@
SYS_PORT_TRACING_FUNC_EXIT(k_thread, foreach_unlocked);
k_spin_unlock(&z_thread_monitor_lock, key);
+#else
+ ARG_UNUSED(user_cb);
+ ARG_UNUSED(user_data);
#endif
}
@@ -895,6 +901,7 @@
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
return arch_float_disable(thread);
#else
+ ARG_UNUSED(thread);
return -ENOTSUP;
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
}
@@ -904,6 +911,8 @@
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
return arch_float_enable(thread, options);
#else
+ ARG_UNUSED(thread);
+ ARG_UNUSED(options);
return -ENOTSUP;
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
}
diff --git a/kernel/work.c b/kernel/work.c
index 402b2f8..010cd73 100644
--- a/kernel/work.c
+++ b/kernel/work.c
@@ -598,6 +598,9 @@
*/
static void work_queue_main(void *workq_ptr, void *p2, void *p3)
{
+ ARG_UNUSED(p2);
+ ARG_UNUSED(p3);
+
struct k_work_q *queue = (struct k_work_q *)workq_ptr;
while (true) {