https://jxself.org/git/linux-libre.git
Raw File
Tip revision: d800048706b7e2b8b2cb396c24bfa3a50d524f3e authored by Jason Self on 01 October 2013, 16:18:12 UTC
Linux-libre 3.10.14-gnu
Tip revision: d800048
reciprocal_div.c
#include <asm/div64.h>
#include <linux/reciprocal_div.h>
#include <linux/export.h>

u32 reciprocal_value(u32 k)
{
	u64 val = (1LL << 32) + (k - 1);
	do_div(val, k);
	return (u32)val;
}
EXPORT_SYMBOL(reciprocal_value);
back to top