lkml.org 
[lkml]   [2017]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:timers/core] timerqueue: Use rb_entry_safe() instead of open-coding it
Commit-ID:  d852d39432f5d9822dd0ea8760573448338caf41
Gitweb: http://git.kernel.org/tip/d852d39432f5d9822dd0ea8760573448338caf41
Author: Geliang Tang <geliangtang@gmail.com>
AuthorDate: Tue, 20 Dec 2016 21:57:44 +0800
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 20 Jan 2017 08:03:42 +0100

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>

---
lib/timerqueue.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/timerqueue.c b/lib/timerqueue.c
index adc6ee0..4a720ed 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);
\
 
 \ /
  Last update: 2017-01-20 08:07    [W:0.062 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site