2022-04-07 20:42:45

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH -next] ftrace: Fix build warning

On Thu, 7 Apr 2022 15:46:12 +0800
YueHaibing <[email protected]> wrote:

> If CONFIG_SYSCTL and CONFIG_DYNAMIC_FTRACE is n, build warns:
>
> kernel/trace/ftrace.c:7912:13: error: ‘is_permanent_ops_registered’ defined but not used [-Werror=unused-function]
> static bool is_permanent_ops_registered(void)
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> kernel/trace/ftrace.c:89:12: error: ‘last_ftrace_enabled’ defined but not used [-Werror=unused-variable]
> static int last_ftrace_enabled;
> ^~~~~~~~~~~~~~~~~~~
>
> Move is_permanent_ops_registered() to ifdef block and mark last_ftrace_enabled as
> __maybe_unused to fix this.
>
> Fixes: 7cde53da38a3 ("ftrace: move sysctl_ftrace_enabled to ftrace.c")
> Signed-off-by: YueHaibing <[email protected]>
> ---
> kernel/trace/ftrace.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Steven Rostedt (Google) <[email protected]>

-- Steve


2022-04-16 00:44:38

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH -next] ftrace: Fix build warning

On Thu, Apr 07, 2022 at 10:59:17AM -0400, Steven Rostedt wrote:
> On Thu, 7 Apr 2022 15:46:12 +0800
> YueHaibing <[email protected]> wrote:
>
> > If CONFIG_SYSCTL and CONFIG_DYNAMIC_FTRACE is n, build warns:
> >
> > kernel/trace/ftrace.c:7912:13: error: ‘is_permanent_ops_registered’ defined but not used [-Werror=unused-function]
> > static bool is_permanent_ops_registered(void)
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> > kernel/trace/ftrace.c:89:12: error: ‘last_ftrace_enabled’ defined but not used [-Werror=unused-variable]
> > static int last_ftrace_enabled;
> > ^~~~~~~~~~~~~~~~~~~
> >
> > Move is_permanent_ops_registered() to ifdef block and mark last_ftrace_enabled as
> > __maybe_unused to fix this.
> >
> > Fixes: 7cde53da38a3 ("ftrace: move sysctl_ftrace_enabled to ftrace.c")
> > Signed-off-by: YueHaibing <[email protected]>
> > ---
> > kernel/trace/ftrace.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Acked-by: Steven Rostedt (Google) <[email protected]>

Queued onto sysctl-testing. I have one more fix I just posted for this too.

Luis