1 #include <linux/kernel.h>
3 #include <linux/reciprocal_div.h>
4 #include <linux/export.h>
7 * For a description of the algorithm please have a look at
8 * include/linux/reciprocal_div.h
11 struct reciprocal_value reciprocal_value(u32 d)
13 struct reciprocal_value R;
18 m = ((1ULL << 32) * ((1ULL << l) - d));
23 R.sh2 = max(l - 1, 0);
27 EXPORT_SYMBOL(reciprocal_value);