Skip to content

Commit bedf068

Browse files
Aashish Sharmarostedt
authored andcommitted
tracing: Fix warning on variable 'struct trace_array'
Move the declaration of 'struct trace_array' out of #ifdef CONFIG_TRACING block, to fix the following warning when CONFIG_TRACING is not set: >> include/linux/trace.h:63:45: warning: 'struct trace_array' declared inside parameter list will not be visible outside of this definition or declaration Link: https://lkml.kernel.org/r/20221107160556.2139463-1-shraash@google.com Fixes: 1a77dd1 ("scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled") Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: Arun Easi <aeasi@marvell.com> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Aashish Sharma <shraash@google.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 649e720 commit bedf068

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/trace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ struct trace_export {
2626
int flags;
2727
};
2828

29+
struct trace_array;
30+
2931
#ifdef CONFIG_TRACING
3032

3133
int register_ftrace_export(struct trace_export *export);
3234
int unregister_ftrace_export(struct trace_export *export);
3335

34-
struct trace_array;
35-
3636
void trace_printk_init_buffers(void);
3737
__printf(3, 4)
3838
int trace_array_printk(struct trace_array *tr, unsigned long ip,

0 commit comments

Comments
 (0)