tracing: avoid warnings from zero-arg tracepoints
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Fri, 17 Apr 2009 06:35:39 +0000 (23:35 -0700)
committerIngo Molnar <mingo@elte.hu>
Fri, 17 Apr 2009 15:52:26 +0000 (17:52 +0200)
Tracepoints with no arguments can issue two warnings:

"field" defined by not used
"ret" is uninitialized in this function

Mark field as being OK to leave unused, and initialize ret.

[ Impact: fix false positive compiler warnings. ]

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: mathieu.desnoyers@polymtl.ca
LKML-Reference: <1239950139-1119-5-git-send-email-jeremy@goop.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/trace/ftrace.h

index 60c5323..39a3351 100644 (file)
@@ -160,8 +160,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags)    \
 static int                                                             \
 ftrace_format_##call(struct trace_seq *s)                              \
 {                                                                      \
-       struct ftrace_raw_##call field;                                 \
-       int ret;                                                        \
+       struct ftrace_raw_##call field __attribute__((unused));         \
+       int ret = 0;                                                    \
                                                                        \
        tstruct;                                                        \
                                                                        \