blob: 75510e94f7d0b2fcd5736a4e0aeb9ff282da11d1 [file] [log] [blame]
Eric Dumazet6a2d7a92006-12-13 00:34:27 -08001#include <asm/div64.h>
2#include <linux/reciprocal_div.h>
Eric Dumazet8af2a212011-12-08 06:06:03 +00003#include <linux/export.h>
Eric Dumazet6a2d7a92006-12-13 00:34:27 -08004
5u32 reciprocal_value(u32 k)
6{
7 u64 val = (1LL << 32) + (k - 1);
8 do_div(val, k);
9 return (u32)val;
10}
Eric Dumazet8af2a212011-12-08 06:06:03 +000011EXPORT_SYMBOL(reciprocal_value);