aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 44108de4f028..0237a556eb1f 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -613,21 +613,19 @@ static inline void run_hrtimer_queue(struct hrtimer_base *base)
613 613
614 while ((node = base->first)) { 614 while ((node = base->first)) {
615 struct hrtimer *timer; 615 struct hrtimer *timer;
616 int (*fn)(void *); 616 int (*fn)(struct hrtimer *);
617 int restart; 617 int restart;
618 void *data;
619 618
620 timer = rb_entry(node, struct hrtimer, node); 619 timer = rb_entry(node, struct hrtimer, node);
621 if (base->softirq_time.tv64 <= timer->expires.tv64) 620 if (base->softirq_time.tv64 <= timer->expires.tv64)
622 break; 621 break;
623 622
624 fn = timer->function; 623 fn = timer->function;
625 data = timer->data;
626 set_curr_timer(base, timer); 624 set_curr_timer(base, timer);
627 __remove_hrtimer(timer, base); 625 __remove_hrtimer(timer, base);
628 spin_unlock_irq(&base->lock); 626 spin_unlock_irq(&base->lock);
629 627
630 restart = fn(data); 628 restart = fn(timer);
631 629
632 spin_lock_irq(&base->lock); 630 spin_lock_irq(&base->lock);
633 631
@@ -664,9 +662,10 @@ struct sleep_hrtimer {
664 int expired; 662 int expired;
665}; 663};
666 664
667static int nanosleep_wakeup(void *data) 665static int nanosleep_wakeup(struct hrtimer *timer)
668{ 666{
669 struct sleep_hrtimer *t = data; 667 struct sleep_hrtimer *t =
668 container_of(timer, struct sleep_hrtimer, timer);
670 669
671 t->expired = 1; 670 t->expired = 1;
672 wake_up_process(t->task); 671 wake_up_process(t->task);
@@ -677,7 +676,6 @@ static int nanosleep_wakeup(void *data)
677static int __sched do_nanosleep(struct sleep_hrtimer *t, enum hrtimer_mode mode) 676static int __sched do_nanosleep(struct sleep_hrtimer *t, enum hrtimer_mode mode)
678{ 677{
679 t->timer.function = nanosleep_wakeup; 678 t->timer.function = nanosleep_wakeup;
680 t->timer.data = t;
681 t->task = current; 679 t->task = current;
682 t->expired = 0; 680 t->expired = 0;
683 681