]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - lib/timerqueue.c
Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-opp'
[linux.git] / lib / timerqueue.c
index 782ae8ca2c06f2b3439b10592cef6a43c31223cd..4a720ed4fdafd575df46159a3d51131902d638e4 100644 (file)
@@ -48,7 +48,7 @@ bool timerqueue_add(struct timerqueue_head *head, struct timerqueue_node *node)
        while (*p) {
                parent = *p;
                ptr = rb_entry(parent, struct timerqueue_node, node);
-               if (node->expires.tv64 < ptr->expires.tv64)
+               if (node->expires < ptr->expires)
                        p = &(*p)->rb_left;
                else
                        p = &(*p)->rb_right;
@@ -56,7 +56,7 @@ bool timerqueue_add(struct timerqueue_head *head, struct timerqueue_node *node)
        rb_link_node(&node->node, parent, p);
        rb_insert_color(&node->node, &head->head);
 
-       if (!head->next || node->expires.tv64 < head->next->expires.tv64) {
+       if (!head->next || node->expires < head->next->expires) {
                head->next = node;
                return true;
        }
@@ -80,8 +80,7 @@ bool timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node)
        if (head->next == node) {
                struct rb_node *rbn = rb_next(&node->node);
 
-               head->next = rbn ?
-                       rb_entry(rbn, struct timerqueue_node, node) : NULL;
+               head->next = rb_entry_safe(rbn, struct timerqueue_node, node);
        }
        rb_erase(&node->node, &head->head);
        RB_CLEAR_NODE(&node->node);