Skip to content

Commit

Permalink
tracing: Fix check of ftrace_trace_arrays list_empty() check
Browse files Browse the repository at this point in the history
The check that tests if ftrace_trace_arrays is empty in
top_trace_array(), uses the .prev pointer:

  if (list_empty(ftrace_trace_arrays.prev))

instead of testing the variable itself:

  if (list_empty(&ftrace_trace_arrays))

Although it is technically correct, it is awkward and confusing.
Use the proper method.

Link: http://lkml.kernel.org/r/87oay1bas8.fsf@sejong.aot.lge.com

Reported-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (Red Hat) committed Jun 10, 2014
1 parent f0b70cc commit da9c341
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static inline struct trace_array *top_trace_array(void)
{
struct trace_array *tr;

if (list_empty(ftrace_trace_arrays.prev))
if (list_empty(&ftrace_trace_arrays))
return NULL;

tr = list_entry(ftrace_trace_arrays.prev,
Expand Down

0 comments on commit da9c341

Please sign in to comment.