[RBTREE] Update hrtimers to use rb_parent() accessor macro.
authorDavid Woodhouse <dwmw2@infradead.org>
Sat, 22 Apr 2006 01:38:50 +0000 (02:38 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Sat, 22 Apr 2006 01:38:50 +0000 (02:38 +0100)
Also switch it to use the same method of using off-tree nodes as
everyone else now does -- set them to point to themselves.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
include/linux/hrtimer.h
kernel/hrtimer.c

index 306acf1dc6d58b54aef407d2ab9e370ff18eaa99..7d2a1b974c5edd4657d647a07b8c62416ae22476 100644 (file)
@@ -127,7 +127,7 @@ extern ktime_t hrtimer_get_next_event(void);
 
 static inline int hrtimer_active(const struct hrtimer *timer)
 {
-       return timer->node.rb_parent != HRTIMER_INACTIVE;
+       return rb_parent(&timer->node) != &timer->node;
 }
 
 /* Forward a hrtimer so it expires after now: */
index d2a7296c8251979b67be6a98640025c0181462c5..04ab27ddfd90d60674856e67a5dd69a96572cab6 100644 (file)
@@ -393,7 +393,7 @@ static void __remove_hrtimer(struct hrtimer *timer, struct hrtimer_base *base)
        if (base->first == &timer->node)
                base->first = rb_next(&timer->node);
        rb_erase(&timer->node, &base->active);
-       timer->node.rb_parent = HRTIMER_INACTIVE;
+       rb_set_parent(&timer->node, &timer->node);
 }
 
 /*
@@ -578,7 +578,7 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
                clock_id = CLOCK_MONOTONIC;
 
        timer->base = &bases[clock_id];
-       timer->node.rb_parent = HRTIMER_INACTIVE;
+       rb_set_parent(&timer->node, &timer->node);
 }
 
 /**