aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/clockevents.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/clockevents.c')
-rw-r--r--kernel/time/clockevents.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 620b58abdc32..05e8aeedcdf3 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -37,10 +37,9 @@ static DEFINE_SPINLOCK(clockevents_lock);
37 * 37 *
38 * Math helper, returns latch value converted to nanoseconds (bound checked) 38 * Math helper, returns latch value converted to nanoseconds (bound checked)
39 */ 39 */
40unsigned long clockevent_delta2ns(unsigned long latch, 40u64 clockevent_delta2ns(unsigned long latch, struct clock_event_device *evt)
41 struct clock_event_device *evt)
42{ 41{
43 u64 clc = ((u64) latch << evt->shift); 42 u64 clc = (u64) latch << evt->shift;
44 43
45 if (unlikely(!evt->mult)) { 44 if (unlikely(!evt->mult)) {
46 evt->mult = 1; 45 evt->mult = 1;
@@ -50,10 +49,10 @@ unsigned long clockevent_delta2ns(unsigned long latch,
50 do_div(clc, evt->mult); 49 do_div(clc, evt->mult);
51 if (clc < 1000) 50 if (clc < 1000)
52 clc = 1000; 51 clc = 1000;
53 if (clc > LONG_MAX) 52 if (clc > KTIME_MAX)
54 clc = LONG_MAX; 53 clc = KTIME_MAX;
55 54
56 return (unsigned long) clc; 55 return clc;
57} 56}
58EXPORT_SYMBOL_GPL(clockevent_delta2ns); 57EXPORT_SYMBOL_GPL(clockevent_delta2ns);
59 58