Page MenuHomeFreeBSD

LinuxKPI: cast jiffies_to_msecs() result
ClosedPublic

Authored by bz on Jun 10 2023, 11:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 24 2024, 3:10 AM
Unknown Object (File)
Sep 24 2024, 2:48 AM
Unknown Object (File)
Sep 12 2024, 8:32 PM
Unknown Object (File)
Sep 5 2024, 1:43 PM
Unknown Object (File)
Sep 2 2024, 4:21 AM
Unknown Object (File)
Aug 29 2024, 12:40 PM
Unknown Object (File)
Aug 29 2024, 8:01 AM
Unknown Object (File)
Aug 29 2024, 7:53 AM

Details

Summary

jiffies_to_msecs() is expected to return an uint_t. In order to avoid
changing printf format strings, properly cast the result to the
expected type.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 51994
Build 48885: arc lint + arc unit

Event Timeline

bz requested review of this revision.Jun 10 2023, 11:11 PM
hselasky added inline comments.
sys/compat/linuxkpi/common/include/linux/jiffies.h
43

What is this macro used for?

Why are you casting forth and back between signed and unsigned?

sys/compat/linuxkpi/common/include/linux/jiffies.h
43

I think it's self-explaining what the macro has done for ages. You were the last one to touch that line.

I am just casting the result to the expected type, everything else was there already Hans.

I see now how Linux defines this macro / function. Sorry, my bad. I was just looking at the change itself, and wondering what happens to negative time differences ...

This revision is now accepted and ready to land.Jun 12 2023, 11:32 PM
This revision was automatically updated to reflect the committed changes.