ftrace: Fix build warning
authorYueHaibing <yuehaibing@huawei.com>
Thu, 7 Apr 2022 07:46:12 +0000 (15:46 +0800)
committerLuis Chamberlain <mcgrof@kernel.org>
Fri, 15 Apr 2022 19:53:21 +0000 (12:53 -0700)
commit5d79fa0d33258d8e79064316ce8fae37e27bd34b
treeb7baa45370cf1365b77ba5762dd7324489ff9a9c
parent383189718496c1fe163f378526f9b86dc7f0cf77
ftrace: Fix build warning

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 <yuehaibing@huawei.com>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
kernel/trace/ftrace.c