diff options
-rw-r--r-- | include/linux/hrtimer.h | 2 | ||||
-rw-r--r-- | include/linux/ktime.h | 4 | ||||
-rw-r--r-- | kernel/hrtimer.c | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index abb674c9b764..98c5c1537b5d 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -85,7 +85,7 @@ struct hrtimer_base { | |||
85 | spinlock_t lock; | 85 | spinlock_t lock; |
86 | struct rb_root active; | 86 | struct rb_root active; |
87 | struct rb_node *first; | 87 | struct rb_node *first; |
88 | unsigned long resolution; | 88 | ktime_t resolution; |
89 | ktime_t (*get_time)(void); | 89 | ktime_t (*get_time)(void); |
90 | struct hrtimer *curr_timer; | 90 | struct hrtimer *curr_timer; |
91 | }; | 91 | }; |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 222a047cc145..1bd6552cc341 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -272,8 +272,8 @@ static inline u64 ktime_to_ns(const ktime_t kt) | |||
272 | * idea of the (in)accuracy of timers. Timer values are rounded up to | 272 | * idea of the (in)accuracy of timers. Timer values are rounded up to |
273 | * this resolution values. | 273 | * this resolution values. |
274 | */ | 274 | */ |
275 | #define KTIME_REALTIME_RES (NSEC_PER_SEC/HZ) | 275 | #define KTIME_REALTIME_RES (ktime_t){ .tv64 = TICK_NSEC } |
276 | #define KTIME_MONOTONIC_RES (NSEC_PER_SEC/HZ) | 276 | #define KTIME_MONOTONIC_RES (ktime_t){ .tv64 = TICK_NSEC } |
277 | 277 | ||
278 | /* Get the monotonic time in timespec format: */ | 278 | /* Get the monotonic time in timespec format: */ |
279 | extern void ktime_get_ts(struct timespec *ts); | 279 | extern void ktime_get_ts(struct timespec *ts); |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index e6e8278bcb18..76d759ce6231 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -518,9 +518,8 @@ int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp) | |||
518 | { | 518 | { |
519 | struct hrtimer_base *bases; | 519 | struct hrtimer_base *bases; |
520 | 520 | ||
521 | tp->tv_sec = 0; | ||
522 | bases = per_cpu(hrtimer_bases, raw_smp_processor_id()); | 521 | bases = per_cpu(hrtimer_bases, raw_smp_processor_id()); |
523 | tp->tv_nsec = bases[which_clock].resolution; | 522 | *tp = ktime_to_timespec(bases[which_clock].resolution); |
524 | 523 | ||
525 | return 0; | 524 | return 0; |
526 | } | 525 | } |