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)
Sat, Jun 13, 10:40 PM
Unknown Object (File)
Fri, Jun 5, 12:03 AM
Unknown Object (File)
Mon, Jun 1, 5:52 AM
Unknown Object (File)
Thu, May 28, 4:46 AM
Unknown Object (File)
Mon, May 25, 7:28 AM
Unknown Object (File)
Sun, May 24, 5:06 PM
Unknown Object (File)
May 15 2026, 8:01 PM
Unknown Object (File)
May 15 2026, 8:01 PM

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.