From: Atsushi Nemoto Date: Fri, 19 Oct 2007 15:28:33 +0000 (+0900) Subject: [MIPS] time: Fix calculation in clockevent_set_clock() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=508a775a3c9c6c3f952338f6722ea8bc92899962;p=openwrt%2Fstaging%2Fblogic.git [MIPS] time: Fix calculation in clockevent_set_clock() Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index c4e6866d5cbc..6c6849a8f136 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c @@ -195,8 +195,8 @@ void __cpuinit clockevent_set_clock(struct clock_event_device *cd, /* Find a shift value */ for (shift = 32; shift > 0; shift--) { - temp = (u64) NSEC_PER_SEC << shift; - do_div(temp, clock); + temp = (u64) clock << shift; + do_div(temp, NSEC_PER_SEC); if ((temp >> 32) == 0) break; }