diff options
Diffstat (limited to 'include/linux/hrtimer.h')
-rw-r--r-- | include/linux/hrtimer.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 4c1a834b9849..1c0473e8ecb4 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -350,13 +350,20 @@ static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { } | |||
350 | /* Basic timer operations: */ | 350 | /* Basic timer operations: */ |
351 | extern int hrtimer_start(struct hrtimer *timer, ktime_t tim, | 351 | extern int hrtimer_start(struct hrtimer *timer, ktime_t tim, |
352 | const enum hrtimer_mode mode); | 352 | const enum hrtimer_mode mode); |
353 | extern int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, | ||
354 | unsigned long range_ns, const enum hrtimer_mode mode); | ||
353 | extern int hrtimer_cancel(struct hrtimer *timer); | 355 | extern int hrtimer_cancel(struct hrtimer *timer); |
354 | extern int hrtimer_try_to_cancel(struct hrtimer *timer); | 356 | extern int hrtimer_try_to_cancel(struct hrtimer *timer); |
355 | 357 | ||
356 | static inline int hrtimer_start_expires(struct hrtimer *timer, | 358 | static inline int hrtimer_start_expires(struct hrtimer *timer, |
357 | enum hrtimer_mode mode) | 359 | enum hrtimer_mode mode) |
358 | { | 360 | { |
359 | return hrtimer_start(timer, hrtimer_get_expires(timer), mode); | 361 | unsigned long delta; |
362 | ktime_t soft, hard; | ||
363 | soft = hrtimer_get_softexpires(timer); | ||
364 | hard = hrtimer_get_expires(timer); | ||
365 | delta = ktime_to_ns(ktime_sub(hard, soft)); | ||
366 | return hrtimer_start_range_ns(timer, hrtimer_get_expires(timer), delta, mode); | ||
360 | } | 367 | } |
361 | 368 | ||
362 | static inline int hrtimer_restart(struct hrtimer *timer) | 369 | static inline int hrtimer_restart(struct hrtimer *timer) |