Re: [PATCH] trace: Fix some checker warnings
From: David Howells
Date: Mon Dec 05 2022 - 03:29:46 EST
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:
> > +#if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
> > static const struct file_operations tracing_max_lat_fops;
> > +#endif
>
> Oops, I missed this part. Why did you introduced this #ifdefs?
Because:
#if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
static const struct file_operations tracing_max_lat_fops = {
in the same file. You get something like an unused symbol warning otherwise
if neither config option is defined.
David