Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18210
b: refs/heads/master
c: c9db4fa
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner committed Jan 12, 2006
1 parent a79bf49 commit 41db4de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2787630c1abb075c935cf47e91beb7c656f48c4
refs/heads/master: c9db4fa11526affde83603fe52595bd1260c1354
3 changes: 1 addition & 2 deletions trunk/include/linux/hrtimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ static inline int hrtimer_active(const struct hrtimer *timer)
}

/* Forward a hrtimer so it expires after now: */
extern unsigned long hrtimer_forward(struct hrtimer *timer,
const ktime_t interval);
extern unsigned long hrtimer_forward(struct hrtimer *timer, ktime_t interval);

/* Precise sleep: */
extern long hrtimer_nanosleep(struct timespec *rqtp,
Expand Down
5 changes: 4 additions & 1 deletion trunk/kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ void unlock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags)
* The number of overruns is added to the overrun field.
*/
unsigned long
hrtimer_forward(struct hrtimer *timer, const ktime_t interval)
hrtimer_forward(struct hrtimer *timer, ktime_t interval)
{
unsigned long orun = 1;
ktime_t delta, now;
Expand All @@ -287,6 +287,9 @@ hrtimer_forward(struct hrtimer *timer, const ktime_t interval)
if (delta.tv64 < 0)
return 0;

if (interval.tv64 < timer->base->resolution.tv64)
interval.tv64 = timer->base->resolution.tv64;

if (unlikely(delta.tv64 >= interval.tv64)) {
nsec_t incr = ktime_to_ns(interval);

Expand Down

0 comments on commit 41db4de

Please sign in to comment.