From 60b1a71982429bc6474a2af4c54b8483d5586fd3 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 10 Jan 2025 13:06:28 -0700 Subject: [PATCH] kernel: poll: Allow 0 events for submitted work Change: commit cc6317d7ac30479db060f60c66bb48a12b2d0be6 Author: Jukka Rissanen Date: Fri Nov 1 14:03:32 2019 +0200 kernel: poll: Allow 0 event input Allows `k_poll` to be user with 0 events, which is useful for allowing just a sleep without having to create artivical events. Allow the same for `k_work_submit_to_queue()` and `k_work_submit()`. Signed-off-by: David Brown --- kernel/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/poll.c b/kernel/poll.c index 05e9fe10c3e066..1ca7f703f91eaf 100644 --- a/kernel/poll.c +++ b/kernel/poll.c @@ -675,7 +675,7 @@ int k_work_poll_submit_to_queue(struct k_work_q *work_q, __ASSERT(work_q != NULL, "NULL work_q\n"); __ASSERT(work != NULL, "NULL work\n"); __ASSERT(events != NULL, "NULL events\n"); - __ASSERT(num_events > 0, "zero events\n"); + __ASSERT(num_events >= 0, "zero events\n"); SYS_PORT_TRACING_FUNC_ENTER(k_work_poll, submit_to_queue, work_q, work, timeout);