Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
fp2-dev
/
kernel
/
msm
/
e3aa52d665ec1a962d1cf025a2e5ee84b3b33406
/
.
/
lib
/
reciprocal_div.c
blob: 6a3bd48fa2a06e500d6695ac936a6ff4143775e4 [
file
] [
log
] [
blame
]
Eric Dumazet
6a2d7a9
2006-12-13 00:34:27 -0800
[
diff
] [
blame
]
1
#include
<asm/div64.h>
2
#include
<linux/reciprocal_div.h>
3
4
u32 reciprocal_value
(
u32 k
)
5
{
6
u64 val
=
(
1LL
<<
32
)
+
(
k
-
1
);
7
do_div
(
val
,
k
);
8
return
(
u32
)
val
;
9
}