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)
Thu, Oct 16, 6:33 PM
Unknown Object (File)
Sun, Oct 5, 11:42 PM
Unknown Object (File)
Aug 15 2025, 6:36 AM
Unknown Object (File)
Jun 23 2025, 11:32 AM
Unknown Object (File)
Jun 20 2025, 5:40 PM
Unknown Object (File)
Jun 17 2025, 5:26 PM
Unknown Object (File)
Jun 15 2025, 7:23 AM
Unknown Object (File)
Jun 14 2025, 8:16 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 Not Applicable
Unit
Tests Not Applicable

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.