Skip to content

Commit

Permalink
tracing: trace_output.c, fix false positive compiler warning
Browse files Browse the repository at this point in the history
This compiler warning:

  CC      kernel/trace/trace_output.o
 kernel/trace/trace_output.c: In function ‘register_ftrace_event’:
 kernel/trace/trace_output.c:544: warning: ‘list’ may be used uninitialized in this function

Is wrong as 'list' is always initialized - but GCC (4.3.2) does not
recognize this relationship properly.

Work around the warning by initializing the variable to NULL.

[ Impact: fix false positive compiler warning ]

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Jaswinder Singh Rajput authored and Ingo Molnar committed May 6, 2009
1 parent 22a7c31 commit 48dd0fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ int register_ftrace_event(struct trace_event *event)
INIT_LIST_HEAD(&event->list);

if (!event->type) {
struct list_head *list;
struct list_head *list = NULL;

if (next_event_type > FTRACE_MAX_EVENT) {

Expand Down

0 comments on commit 48dd0fe

Please sign in to comment.