aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Moore <dougm@FreeBSD.org>2019-05-03 02:55:54 +0000
committerDoug Moore <dougm@FreeBSD.org>2019-05-03 02:55:54 +0000
commit64f8d2575a8985e29624fe2336cd516db43377dd (patch)
tree8a3c22b476cd2ef7ab492e7eca26eab29f0f9f7b
parent8c74ade848e981980eec7274c7af82505e6cd93f (diff)
Notes
-rw-r--r--sys/vm/vm_pageout.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index e4c0206a598d..923ba703b9ab 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -928,9 +928,7 @@ isqrt(u_int num)
{
u_int bit, root, tmp;
- bit = 1u << ((NBBY * sizeof(u_int)) - 2);
- while (bit > num)
- bit >>= 2;
+ bit = num != 0 ? (1u << ((fls(num) - 1) & ~1)) : 0;
root = 0;
while (bit != 0) {
tmp = root + bit;