https://github.com/torvalds/linux
Raw File
Tip revision: 3146b39c185f8a436d430132457e84fa1d8f8208 authored by Linus Torvalds on 02 October 2007, 03:24:52 UTC
Linux 2.6.23-rc9
Tip revision: 3146b39
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