LKML Archive on
help / color / mirror / Atom feed
* [PATCH] Fix accidental implicit cast in HR-timer conversion
@ 2008-11-05 17:38 David Howells
  0 siblings, 0 replies; only message in thread
From: David Howells @ 2008-11-05 17:38 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: arjan, tglx, linux-kernel, dhowells

Fix the hrtimer_add_expires_ns() function.  It should take a 'u64 ns' argument,
but rather takes an 'unsigned long ns' argument - which might only be 32-bits.

On FRV, this results in the kernel locking up because hrtimer_forward() passes
the result of a 64-bit multiplication to this function, for which the compiler
discards the top 32-bits - something that didn't happen when ktime_add_ns() was
called directly.

Signed-off-by: David Howells <>
Acked-by: Arjan van de Ven <>

 include/linux/hrtimer.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 2b3645b..07e510a 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -239,7 +239,7 @@ static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time)
 	timer->_softexpires = ktime_add_safe(timer->_softexpires, time);
-static inline void hrtimer_add_expires_ns(struct hrtimer *timer, unsigned long ns)
+static inline void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns)
 	timer->_expires = ktime_add_ns(timer->_expires, ns);
 	timer->_softexpires = ktime_add_ns(timer->_softexpires, ns);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-05 17:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-05 17:38 [PATCH] Fix accidental implicit cast in HR-timer conversion David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).