Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel: poll: Allow 0 events for submitted work #83829

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

d3zd3z
Copy link
Collaborator

@d3zd3z d3zd3z commented Jan 10, 2025

Change:
commit cc6317d
Author: Jukka Rissanen jukka.rissanen@linux.intel.com
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().

@d3zd3z d3zd3z requested review from andyross and jukkar January 10, 2025 20:12
@zephyrbot zephyrbot added area: Kernel size: XS A PR changing only a single line of code labels Jan 10, 2025
@d3zd3z d3zd3z changed the title kernel: poll: Allow 0 event for submitted work kernel: poll: Allow 0 events for submitted work Jan 10, 2025
peter-mitsis
peter-mitsis previously approved these changes Jan 10, 2025
andyross
andyross previously approved these changes Jan 11, 2025
cfriedt
cfriedt previously approved these changes Jan 11, 2025
@@ -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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in commit msg, s/artivical/artificial/

kernel/poll.c Outdated
@@ -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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the message now a bit misleading as we allow zero events, should this be something like invalid event count or similar?

Copy link
Collaborator

@kartben kartben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest addressing the comment made by @jukkar since it doesn't really make sense to leave this mistake there now that it's been spotted

Change:
    commit cc6317d
    Author: Jukka Rissanen <jukka.rissanen@linux.intel.com>
    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 artificial events.

Allow the same for `k_work_submit_to_queue()` and `k_work_submit()`.

Signed-off-by: David Brown <david.brown@linaro.org>
@d3zd3z
Copy link
Collaborator Author

d3zd3z commented Jan 15, 2025

I believe I've addressed both issues: @kartben @jukkar

@kartben kartben requested a review from cfriedt January 16, 2025 10:10
@kartben
Copy link
Collaborator

kartben commented Jan 18, 2025

@andyross @peter-mitsis refresh +1? Thanks! 😊

@kartben kartben merged commit 19a376a into zephyrproject-rtos:main Jan 21, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel size: XS A PR changing only a single line of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants