diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2022-02-08 19:13:40 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2022-02-08 19:44:23 +0000 |
commit | a1f9326607dea5ab6979935e3ca2d7402dcc7cc1 (patch) | |
tree | 3ef10ee5939408d8f74fd724a41cd1d69e9a7137 | |
parent | 14a15342bbc88906c97fbf84553eb5c6de8295ca (diff) | |
download | src-a1f9326607dea5ab6979935e3ca2d7402dcc7cc1.tar.gz src-a1f9326607dea5ab6979935e3ca2d7402dcc7cc1.zip |
libc binuptime(): use the right function to get the most significant bit index
Reported and tested by: Jaroslaw Pelczar <jarek@jpelczar.com>
PR: 261781
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
-rw-r--r-- | lib/libc/sys/__vdso_gettimeofday.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/sys/__vdso_gettimeofday.c b/lib/libc/sys/__vdso_gettimeofday.c index c1457a54d37e..cf1400cdf291 100644 --- a/lib/libc/sys/__vdso_gettimeofday.c +++ b/lib/libc/sys/__vdso_gettimeofday.c @@ -83,9 +83,9 @@ binuptime(struct bintime *bt, struct vdso_timekeep *tk, bool abs) return (error); scale = th->th_scale; #ifdef _LP64 - scale_bits = ffsl(scale); + scale_bits = flsl(scale); #else - scale_bits = ffsll(scale); + scale_bits = flsll(scale); #endif if (__predict_false(scale_bits + fls(delta) > 63)) { x = (scale >> 32) * delta; |