mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
timerqueue: Use rb_entry_safe() instead of open-coding it
Signed-off-by: Geliang Tang <geliangtang@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: John Stultz <john.stultz@linaro.org> Link: http://lkml.kernel.org/r/0d5cf199ac43792df0b6f7e2145545c30fa1dbbe.1482222135.git.geliangtang@gmail.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
9e3d6223d2
commit
d852d39432
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user