diff options
Diffstat (limited to 'kernel/time/clockevents.c')
| -rw-r--r-- | kernel/time/clockevents.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 620b58abdc32..20a8920029ee 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | #include <linux/sysdev.h> | 20 | #include <linux/sysdev.h> |
| 21 | #include <linux/tick.h> | 21 | #include <linux/tick.h> |
| 22 | 22 | ||
| 23 | #include "tick-internal.h" | ||
| 24 | |||
| 23 | /* The registered clock event devices */ | 25 | /* The registered clock event devices */ |
| 24 | static LIST_HEAD(clockevent_devices); | 26 | static LIST_HEAD(clockevent_devices); |
| 25 | static LIST_HEAD(clockevents_released); | 27 | static LIST_HEAD(clockevents_released); |
| @@ -37,10 +39,9 @@ static DEFINE_SPINLOCK(clockevents_lock); | |||
| 37 | * | 39 | * |
| 38 | * Math helper, returns latch value converted to nanoseconds (bound checked) | 40 | * Math helper, returns latch value converted to nanoseconds (bound checked) |
| 39 | */ | 41 | */ |
| 40 | unsigned long clockevent_delta2ns(unsigned long latch, | 42 | u64 clockevent_delta2ns(unsigned long latch, struct clock_event_device *evt) |
| 41 | struct clock_event_device *evt) | ||
| 42 | { | 43 | { |
| 43 | u64 clc = ((u64) latch << evt->shift); | 44 | u64 clc = (u64) latch << evt->shift; |
| 44 | 45 | ||
| 45 | if (unlikely(!evt->mult)) { | 46 | if (unlikely(!evt->mult)) { |
| 46 | evt->mult = 1; | 47 | evt->mult = 1; |
| @@ -50,10 +51,10 @@ unsigned long clockevent_delta2ns(unsigned long latch, | |||
| 50 | do_div(clc, evt->mult); | 51 | do_div(clc, evt->mult); |
| 51 | if (clc < 1000) | 52 | if (clc < 1000) |
| 52 | clc = 1000; | 53 | clc = 1000; |
| 53 | if (clc > LONG_MAX) | 54 | if (clc > KTIME_MAX) |
| 54 | clc = LONG_MAX; | 55 | clc = KTIME_MAX; |
| 55 | 56 | ||
| 56 | return (unsigned long) clc; | 57 | return clc; |
| 57 | } | 58 | } |
| 58 | EXPORT_SYMBOL_GPL(clockevent_delta2ns); | 59 | EXPORT_SYMBOL_GPL(clockevent_delta2ns); |
| 59 | 60 | ||
