Maemo patchset 20101501+0m5
[h-e-n] / kernel / time / clockevents.c
index f8d9680..f27c78a 100644 (file)
@@ -36,7 +36,7 @@ static DEFINE_SPINLOCK(clockevents_lock);
  *
  * Math helper, returns latch value converted to nanoseconds (bound checked)
  */
-unsigned long clockevent_delta2ns(unsigned long latch,
+unsigned long long clockevent_delta2ns(unsigned long latch,
                                  struct clock_event_device *evt)
 {
        u64 clc = ((u64) latch << evt->shift);
@@ -49,10 +49,10 @@ unsigned long clockevent_delta2ns(unsigned long latch,
        do_div(clc, evt->mult);
        if (clc < 1000)
                clc = 1000;
-       if (clc > LONG_MAX)
-               clc = LONG_MAX;
+       if (clc > LLONG_MAX)
+               clc = LLONG_MAX;
 
-       return (unsigned long) clc;
+       return (unsigned long long) clc;
 }
 
 /**