Skip to content

Commit

Permalink
tracing/stat: remove unappropriate safe walk on list
Browse files Browse the repository at this point in the history
register_stat_tracer() uses list_for_each_entry_safe
to check whether a tracer is already present in the list.
But we don't delete anything from the list here, so
we don't need the safe version

[ Impact: cleanup list use is stat tracing ]

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
  • Loading branch information
Frederic Weisbecker committed Jun 1, 2009
1 parent dbd3fbd commit 43bd123
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/trace/trace_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static int init_stat_file(struct stat_session *session)

int register_stat_tracer(struct tracer_stat *trace)
{
struct stat_session *session, *node, *tmp;
struct stat_session *session, *node;
int ret;

if (!trace)
Expand All @@ -327,7 +327,7 @@ int register_stat_tracer(struct tracer_stat *trace)

/* Already registered? */
mutex_lock(&all_stat_sessions_mutex);
list_for_each_entry_safe(node, tmp, &all_stat_sessions, session_list) {
list_for_each_entry(node, &all_stat_sessions, session_list) {
if (node->ts == trace) {
mutex_unlock(&all_stat_sessions_mutex);
return -EINVAL;
Expand Down

0 comments on commit 43bd123

Please sign in to comment.