https://github.com/torvalds/linux
Raw File
Tip revision: 39403865d2e4590802553370a56c9ab93131e4ee authored by Linus Torvalds on 13 May 2007, 01:45:56 UTC
Linux 2.6.22-rc1
Tip revision: 3940386
reciprocal_div.c
#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;
}
back to top