* [PATCH] trace/trace_stat: use rb_entry()
@ 2016-12-19 15:05 Geliang Tang
0 siblings, 0 replies; only message in thread
From: Geliang Tang @ 2016-12-19 15:05 UTC (permalink / raw)
To: Steven Rostedt, Ingo Molnar; +Cc: Geliang Tang, linux-kernel
To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
kernel/trace/trace_stat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace_stat.c b/kernel/trace/trace_stat.c
index 413ff10..0765150 100644
--- a/kernel/trace/trace_stat.c
+++ b/kernel/trace/trace_stat.c
@@ -91,7 +91,7 @@ static int insert_stat(struct rb_root *root, void *stat, cmp_stat_t cmp)
struct stat_node *this;
int result;
- this = container_of(*new, struct stat_node, node);
+ this = rb_entry(*new, struct stat_node, node);
result = cmp(data->stat, this->stat);
parent = *new;
@@ -215,7 +215,7 @@ static void stat_seq_stop(struct seq_file *s, void *p)
static int stat_seq_show(struct seq_file *s, void *v)
{
struct stat_session *session = s->private;
- struct stat_node *l = container_of(v, struct stat_node, node);
+ struct stat_node *l = rb_entry(v, struct stat_node, node);
if (v == SEQ_START_TOKEN)
return session->ts->stat_headers(s);
--
2.9.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-12-19 15:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-19 15:05 [PATCH] trace/trace_stat: use rb_entry() Geliang Tang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.