-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
macros: deleted macros SECONDS(), MSEC(), USEC() #13912
Conversation
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.
Nitpickery: first, we're supposed to be namespacing our macros, so these should probably start with Z_ as you're adding new ones.
And as far as the name goes "x_PER_y" sounds like a single scalar conversion factor (which we already have) where this is a macro doing the conversion itself. Maybe "Z_{M,U,}SEC_TO_TICKS()" would be better names?
But not worth fighting over. This usage seems to be fine to my eyes given the complaint in the bug.
We have 6 more people, so they can say something about names too. |
Codecov Report
@@ Coverage Diff @@
## master #13912 +/- ##
=========================================
Coverage ? 52.29%
=========================================
Files ? 307
Lines ? 45452
Branches ? 10519
=========================================
Hits ? 23771
Misses ? 16887
Partials ? 4794
Continue to review full report at Codecov.
|
Substance of this patch looks good. |
Make like Z_{M,U,}SEC_TO_TICKS(), right? By the way, some Shippable errors, can't understand what is wrong. |
Well, it depends on whether the API is private to the kernel, or public to applications which determines whether to use the Z_ or K_ prefix, but yes that's what we had in mind. To me the intention behind these macros appears to be public-facing, so K_ would be appropriate. |
If we start namespacing things with |
@maxxlife, Thanks for picking this up! I agree with comments of @andyross and @andrewboie, to summarize, |
Thanks. Do you know how to solve problem with Shippable? |
Well, just click thru the web UI to get to the error messages. E.g.
|
Oh, now I will keep in mind. Never worked with Shippable before. In the evening (~ after 5 hours) will fix it. |
See #9882 |
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.
Should we actually get rid of the ticks version as I thought that ticks != ms
and to me it looks like all the usage patched by this PR expects milliseconds?
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.
Let me give -1 for time being until the ticks vs ms is clarified.
Heh, @maxxlife, you may have bitten off a design issue. In theory all (really, all) use of "ticks" should be internal to the kernel: the timeout system, IPC timeouts, etc... We don't expose ticks as an API anymore. So if you see ones outside the kernel directory, they're probably wrong. And if you don't see any inside the kernel, then the proper patch becomes to remove these macros entirely. |
@andyross I checked code |
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.
Code looks fine to me, but can you squash these? Really this should be just one patch.
@andyross Delete all previous commits, am I right? |
Right. Submit just one patch with one commit message. |
To elaborate: |
69586d5
to
be7293c
Compare
@pfalcon It seems I made it. |
What exactly? I still see 5 commits in this PR. After interactive rebase using "squash" operations, you need to |
23c8d79
to
08354ba
Compare
Changed everywhere these macros to the K_MSEC(), K_SECONDS() Signed-off-by: Maksim Masalski <maxxliferobot@gmail.com>
08354ba
to
9fc0546
Compare
The first step is always the hardest, but finally I made it! |
Looks good, thanks! |
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.
Code looks good to me now, though I'll admit I'm a little creeped out at how many spots are being changed in the test code. A default kconfig is going to have a 100 Hz tick rate, and the ms numbers were now getting from those macros are 10x higher than what we had, even if they clearly reflect the intent of the code.
If everything passes, I guess I'm fine. But I'd be prepared for some rough waters ahead as things restabilize. Surely something's going to break somewhere.
My concern turned out to be just badly named variables
Using help of the community, we decided to delete these macros SECONDS(), MSEC() and USEC() and replace them with K_MSEC() and K_SECONDS()
Fixes: #7817
Signed-off-by: Maksim Masalski maxxliferobot@gmail.com