-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
coccinelle: standardize kernel timeout arguments #19562
Conversation
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
No complaints here beyond whines about a bunch of extra work, I guess. Is the intent to get this in first and then have me rebase all the collisions in #17155 on top? |
87d2bf2
to
211125d
Compare
Short answer: no, the intent is to get this in, then revisit the goals of #17155 and proceed in a more sustainable manner. The longer answer is here. |
drivers/bluetooth/hci/userchan.c
Outdated
@@ -68,7 +68,7 @@ static bool uc_ready(void) | |||
{ | |||
struct pollfd pollfd = { .fd = uc_fd, .events = POLLIN }; | |||
|
|||
return (poll(&pollfd, 1, 0) == 1); | |||
return (poll(&pollfd, 1, K_NO_WAIT) == 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is calling a libc API for the native posix build (i.e. the host libc), so this change is wrong (it will break once the macro expands to something else than an integer).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Mis-placed parentheses in the regular expression caused the conversion to affect poll
instead of k_poll
. Fixed now.
Some legacy code still passes integer literals in milliseconds as the value to functions that take a timeout. This usage interferes with plans to replace the millisecond representation with a more generic k_timeout_t value. Add a Coccinelle script to convert call sites to use the proper constants and macros. Signed-off-by: Peter Bigot <[email protected]>
Use the int_literal_to_timeout Coccinelle script to convert literal integer arguments for kernel API timeout parameters to the standard timeout value representations. Signed-off-by: Peter Bigot <[email protected]>
211125d
to
b040b66
Compare
What's the process for removing the shippable override patch without triggering CI again, which will then fail? |
|
3548645
to
b040b66
Compare
@galak Thanks, done. Looks like history of the success has disappeared, but it was https://app.shippable.com/github/zephyrproject-rtos/zephyr/runs/52375/summary/console. |
merged |
Legacy code uses integer literal delays measured in milliseconds as arguments to kernel API that is intended to take timeout values. Replace these integers with the corresponding defined constants and macro conversions that represent the timeout values.
This is a demonstration and prototype of using semantic patch technology to repeatably perform the conversions necessary to support #17155, done in a way that is reviewable, verifiable, and easy to re-apply when pending work is merged to master or rebases are required.