Page MenuHomeFreeBSD

Add nsecs_to_jiffies64() and jiffies_to_{nsecs,usecs}().
ClosedPublic

Authored by markj on Jul 8 2017, 7:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 19, 7:01 PM
Unknown Object (File)
Tue, Nov 5, 4:02 PM
Unknown Object (File)
Oct 27 2024, 12:59 AM
Unknown Object (File)
Oct 2 2024, 6:51 AM
Unknown Object (File)
Oct 1 2024, 4:23 PM
Unknown Object (File)
Sep 30 2024, 2:59 AM
Unknown Object (File)
Sep 29 2024, 9:32 AM
Unknown Object (File)
Sep 25 2024, 6:35 AM
Subscribers

Details

Summary

Fix style in related functions.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 10411
Build 10821: arc lint + arc unit

Event Timeline

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

These max checks are not sufficient for very large input values. You should also verify that the multiplication does not exceed 64-bits!

const uint64_t nsec_max = -1ULL / (uint64_t)hz;
if (nsec > nsec_max)
nsec = nsec_max;
117

passed jiffies argument should be "int" to avoid problems!

  • Address review comments.
sys/compat/linuxkpi/common/include/linux/jiffies.h
99

Can you add this check to the msecs_to_jiffies and usecs_to_jiffies aswell?

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

Do you need to cast j to (uint64_t) ??

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

(uint64_t)(unsigned int)j ???

We don't like negative times??

Same below. Else the patch looks OK.

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

Done.

120

Sorry, that was stupid. :(

Thanks for the review.

This revision was automatically updated to reflect the committed changes.