-
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: final pass standardizing integer timeout parameters #19650
Conversation
All checks are passing now. checkpatch (informational only, not a failure)
Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
e888dbf
to
bffd4fc
Compare
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.
looks good in my areas
bffd4fc
to
4bbcdd0
Compare
.shippable.yml
Outdated
@@ -6,13 +6,28 @@ env: | |||
global: |
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.
please remove this change, we will need to override CI in this case..
@@ -419,7 +419,8 @@ static void tmbox_get(struct k_mbox *pmbox) | |||
NULL); |
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.
Please put this with other code change and separate it from the coccinelle script change.
4bbcdd0
to
02c2427
Compare
Sort the functions within the regular expression so they can be checked more easily. Remove k_thread_deadline_set as it takes an argument in cycles. (The one in-tree call to this function was not affected by this error.) Add missed k_mbox_data_block_get. Fix an overly ambitious multi-match disjunct that covered some non-existent functions. Signed-off-by: Peter Bigot <[email protected]>
Re-run with updated script to convert integer literal delay arguments to k_mbox_data_block_get to use the standard timeout macros. Signed-off-by: Peter Bigot <[email protected]>
k_sleep uses the same underlying thread infrastructure as the other functions that take timeouts, so the delay should be specified as a timeout rather than milliseconds. Signed-off-by: Peter Bigot <[email protected]>
Re-run with updated script to convert integer literal delay arguments to k_sleep to use the standard timeout macros. Signed-off-by: Peter Bigot <[email protected]>
…tion k_thread_create and K_THREAD_DEFINE both take a delay as the final parameter. Most uses of K_THREAD_DEFINE pass either `K_NO_WAIT` or `K_FOREVER`. Ensure that all uses of K_THREAD_DEFINE follow that practice, and that the runtime k_thread_create calls do so as well. Signed-off-by: Peter Bigot <[email protected]>
…eouts Re-run with updated script to convert integer literal delay arguments to k_thread_create and K_THREAD_DEFINE to use the standard timeout macros. Signed-off-by: Peter Bigot <[email protected]>
02c2427
to
ca34569
Compare
@nashif shippable patch removed, API change separated, rebased on current master (no new changes were required). |
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.
display related changes LGTM
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.
No complaints for the few files I own.
(At least I think this is final, but I've thought that before.)
This PR like the others is best reviewed at the commit level, as there are a lot of rote changes. Only the changes to the
.cocci
script are by hand.Three features in this:
Fixed a few errors in the existing regular expression intended to detect API calls that passed a timeout in the last parameter. No errors resulted in incorrect conversion in previous PRs, and only one missed function resulted in a new conversion.
Convert
k_sleep
to take timeouts. There's been some discussion of whether this should remain milliseconds, but the consensus was that being able to use explicit duration macros likeK_MSEC
andK_SECONDS
was highly desired. The scale tipped to "timeout" for me when I discovered thatk_sleep()
specifically relies on the thread timeout infrastructure (it's a no-op if threads are disabled). If the consensus switches again, those commits can be dropped.I have a proposal in Generalizing duration representation in clock-agnostic way #19656 that would preserve use those API macros for time-defined timeouts even when New timeout API #17155 revisions are done so unifying it now seems to make sense. If that proposal doesn't fly we'd still want to replace these.
Convert static and runtime thread start delays to timeouts. Most static definitions did this already, but it took me a while to figure out how to make Coccinelle convert the missing ones.