OSDN Git Service
(root)
/
android-x86
/
kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
x86/uaccess: Don't leak the AC flags into __get_user() argument evaluation
[android-x86/kernel.git]
/
lib
/
int_sqrt.c
diff --git
a/lib/int_sqrt.c
b/lib/int_sqrt.c
index
1ef4cc3
..
6d35274
100644
(file)
--- a/
lib/int_sqrt.c
+++ b/
lib/int_sqrt.c
@@
-7,6
+7,7
@@
#include <linux/kernel.h>
#include <linux/export.h>
+#include <linux/bitops.h>
/**
* int_sqrt - rough approximation to sqrt
@@
-21,7
+22,7
@@
unsigned long int_sqrt(unsigned long x)
if (x <= 1)
return x;
- m = 1UL << (
BITS_PER_LONG - 2
);
+ m = 1UL << (
__fls(x) & ~1UL
);
while (m != 0) {
b = y + m;
y >>= 1;