git: c6df21760381 - main - linux(4): Use the right function to get the bit index in vdso binuptime.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 08 May 2022 14:21:47 UTC
The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c6df21760381c3e48bcd412705de6f0ded9e4aae commit c6df21760381c3e48bcd412705de6f0ded9e4aae Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2022-05-08 14:20:52 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2022-05-08 14:20:52 +0000 linux(4): Use the right function to get the bit index in vdso binuptime. This is modeled after a1f93266 (by kib@). MFC after: 2 weeks --- sys/compat/linux/linux_vdso_gtod.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/compat/linux/linux_vdso_gtod.inc b/sys/compat/linux/linux_vdso_gtod.inc index 7320ce998d80..f101fe81f7f8 100644 --- a/sys/compat/linux/linux_vdso_gtod.inc +++ b/sys/compat/linux/linux_vdso_gtod.inc @@ -37,25 +37,25 @@ fls(int mask) #ifdef _LP64 static int -ffsl(long mask) +flsl(long mask) { int bit; if (mask == 0) return (0); - for (bit = 1; !(mask & 1); bit++) + for (bit = 1; mask != 1; bit++) mask = (unsigned long)mask >> 1; return (bit); } #else static int -ffsll(long long mask) +flsll(long long mask) { int bit; if (mask == 0) return (0); - for (bit = 1; !(mask & 1); bit++) + for (bit = 1; mask != 1; bit++) mask = (unsigned long long)mask >> 1; return (bit); } @@ -186,9 +186,9 @@ freebsd_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;