mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 09:13:20 -05: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
1 changed files with 1 additions and 2 deletions
|
@ -80,8 +80,7 @@ bool timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node)
|
||||||
if (head->next == node) {
|
if (head->next == node) {
|
||||||
struct rb_node *rbn = rb_next(&node->node);
|
struct rb_node *rbn = rb_next(&node->node);
|
||||||
|
|
||||||
head->next = rbn ?
|
head->next = rb_entry_safe(rbn, struct timerqueue_node, node);
|
||||||
rb_entry(rbn, struct timerqueue_node, node) : NULL;
|
|
||||||
}
|
}
|
||||||
rb_erase(&node->node, &head->head);
|
rb_erase(&node->node, &head->head);
|
||||||
RB_CLEAR_NODE(&node->node);
|
RB_CLEAR_NODE(&node->node);
|
||||||
|
|
Loading…
Add table
Reference in a new issue