git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git]
/
lib
/
reciprocal_div.c
diff --git a/lib/reciprocal_div.c
b/lib/reciprocal_div.c
new file mode 100644
(file)
index 0000000..
6a3bd48
--- /dev/null
+++ b/
lib/reciprocal_div.c
@@ -0,0
+1,9
@@
+#include <asm/div64.h>
+#include <linux/reciprocal_div.h>
+
+u32 reciprocal_value(u32 k)
+{
+ u64 val = (1LL << 32) + (k - 1);
+ do_div(val, k);
+ return (u32)val;
+}