Re: x86: Clean up computation of HPET .mult variables

From: Daniel Walker
Date: Mon May 05 2008 - 19:58:23 EST



On Mon, 2008-05-05 at 20:11 -0300, Carlos R. Mafra wrote:

> - tmp = (u64)hpet_period << HPET_SHIFT;
> - do_div(tmp, FSEC_PER_NSEC);
> - clocksource_hpet.mult = (u32)tmp;
> + clocksource_hpet.mult = div_sc(hpet_period, FSEC_PER_NSEC, HPET_SHIFT);
>

There's helper functions that should be used called clocksource_hz2mult
and one called clocksource_khz2mult. I think they're more accurate than
using div_sc.

Daniel

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/