]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
time(3): Optimize tvtohz() function.
authorHans Petter Selasky <hselasky@FreeBSD.org>
Thu, 20 Oct 2022 16:49:51 +0000 (18:49 +0200)
committerHans Petter Selasky <hselasky@FreeBSD.org>
Sun, 23 Oct 2022 08:04:50 +0000 (10:04 +0200)
commit35a33d14b593ba93feb8fed8d0689bc8e0edd15b
treeba06695fff8b2516c916432472db0cae5bb61ba7
parentee29897fc3d66ba7006c9ee3f524bf2e8cf30a4f
time(3): Optimize tvtohz() function.

List of changes:
- Use integer multiplication instead of long multiplication, because the result is an integer.
- Remove multiple if-statements and predict new if-statements.
- Rename local variable name, "ticks" into "retval" to avoid shadowing
the system "ticks" global variable.

Reviewed by: kib@ and imp@
MFC after: 1 week
Sponsored by: NVIDIA Networking
Differential Revision:  https://reviews.freebsd.org/D36859
sys/kern/kern_clock.c
sys/kern/subr_param.c
sys/sys/time.h