Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
[sliver-openvswitch.git] / datapath / linux / compat / reciprocal_div.c
1 #include <asm/div64.h>
2 #include <linux/reciprocal_div.h>
3
4 #include <linux/version.h>
5 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
6 /* definition is required since reciprocal_value() is not exported */
7 u32 reciprocal_value(u32 k)
8 {
9         u64 val = (1LL << 32) + (k - 1);
10         do_div(val, k);
11         return (u32)val;
12 }
13 #endif