[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41b8a9ba-955b-cf80-118f-f0c2bad619ae@marvell.com>
Date: Tue, 15 Nov 2022 16:16:33 -0800
From: Arun Easi <aeasi@...vell.com>
To: Aashish Sharma <shraash@...gle.com>
CC: Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [EXT] [PATCH] tracing: Fix warning on variable 'struct
trace_array'
On Mon, 7 Nov 2022, 8:05am, Aashish Sharma wrote:
>
> ----------------------------------------------------------------------
> 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
>
> Fixes: 1a77dd1c2bb5 ("scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled")
> Cc: Arun Easi <aeasi@...vell.com>
> Signed-off-by: Aashish Sharma <shraash@...gle.com>
> ---
> include/linux/trace.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/trace.h b/include/linux/trace.h
> index b5e16e438448..80ffda871749 100644
> --- a/include/linux/trace.h
> +++ b/include/linux/trace.h
> @@ -26,13 +26,13 @@ struct trace_export {
> int flags;
> };
>
> +struct trace_array;
> +
> #ifdef CONFIG_TRACING
>
> int register_ftrace_export(struct trace_export *export);
> int unregister_ftrace_export(struct trace_export *export);
>
> -struct trace_array;
> -
> void trace_printk_init_buffers(void);
> __printf(3, 4)
> int trace_array_printk(struct trace_array *tr, unsigned long ip,
>
Looks good. Thanks!
I was wondering why I did not see this when I compiled the kernel without
TRACING (for 1a77dd1c2bb5). Apparently, I had linux/trace_events.h
included, which does exactly this. Anyway, makes sense to move this
outside the #ifdef block.
Regards,
-Arun
Powered by blists - more mailing lists