[for-next][PATCH 4/4] tracing: Fix check of ftrace_trace_arrays list_empty() check

From: Steven Rostedt
Date: Tue Jun 10 2014 - 22:01:54 EST


From: "Steven Rostedt (Red Hat)" <rostedt@xxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxx

Reported-by: Namhyung Kim <namhyung@xxxxxxxxx>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
kernel/trace/trace.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 9e82551dd566..9258f5a815db 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -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,
--
2.0.0.rc2


--
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/