[PATCH 14/25] perf tools: Remove redundant initialization of thread linkage members

From: Arnaldo Carvalho de Melo
Date: Wed May 27 2015 - 11:43:34 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

A thread moves from a rb tree to a list, but can't be on both, because
those linkage members are in a union. This is leftover from when I was
debugging thread refcounting and had nuked that union.

It is harmless duplication, as RB_CLEAR_NODE() does again what
INIT_LIST_HEAD does.

Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Don Zickus <dzickus@xxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-hmma9lmip6qlhzhgkhp9tzd1@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/thread.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 16c28a37a9e4..28c4b746baa1 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -54,7 +54,6 @@ struct thread *thread__new(pid_t pid, pid_t tid)

list_add(&comm->list, &thread->comm_list);
atomic_set(&thread->refcnt, 0);
- INIT_LIST_HEAD(&thread->node);
RB_CLEAR_NODE(&thread->rb_node);
}

@@ -70,7 +69,6 @@ void thread__delete(struct thread *thread)
struct comm *comm, *tmp;

BUG_ON(!RB_EMPTY_NODE(&thread->rb_node));
- BUG_ON(!list_empty(&thread->node));

thread_stack__free(thread);

--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/