Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] Fix calculation in clockevent_set_clock()
@ 2007-10-19 15:28 Atsushi Nemoto
  2007-10-22 12:30 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2007-10-19 15:28 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index c4e6866..6c6849a 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;
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-22 12:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-19 15:28 [PATCH] Fix calculation in clockevent_set_clock() Atsushi Nemoto
2007-10-22 12:30 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox