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 29, 12:11 AM
Unknown Object (File)
Fri, Jun 21, 4:06 PM
Unknown Object (File)
Apr 22 2024, 5:09 PM
Unknown Object (File)
Jan 14 2024, 9:09 AM
Unknown Object (File)
Dec 20 2023, 10:25 AM
Unknown Object (File)
Dec 20 2023, 8:25 AM
Unknown Object (File)
Nov 6 2023, 7:11 AM
Unknown Object (File)
Oct 15 2023, 2:19 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.