aboutsummaryrefslogtreecommitdiffstats
path: root/lib/timerqueue.c
diff options
context:
space:
mode:
authorGeliang Tang <[email protected]>2016-12-20 13:57:44 +0000
committerThomas Gleixner <[email protected]>2017-01-20 07:03:42 +0000
commitd852d39432f5d9822dd0ea8760573448338caf41 (patch)
treebccd8214d1c5fd4d0f9c9d90e17ee5edb260d729 /lib/timerqueue.c
parentmath64, timers: Fix 32bit mul_u64_u32_shr() and friends (diff)
downloadkernel-d852d39432f5d9822dd0ea8760573448338caf41.tar.gz
kernel-d852d39432f5d9822dd0ea8760573448338caf41.zip
timerqueue: Use rb_entry_safe() instead of open-coding it
Signed-off-by: Geliang Tang <[email protected]> Cc: Andrew Morton <[email protected]> Cc: John Stultz <[email protected]> Link: http://lkml.kernel.org/r/0d5cf199ac43792df0b6f7e2145545c30fa1dbbe.1482222135.git.geliangtang@gmail.com Signed-off-by: Thomas Gleixner <[email protected]>
Diffstat (limited to 'lib/timerqueue.c')
-rw-r--r--lib/timerqueue.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/timerqueue.c b/lib/timerqueue.c
index adc6ee0a5126..4a720ed4fdaf 100644
--- a/lib/timerqueue.c
+++ b/lib/timerqueue.c
@@ -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);