ftrace: Set direct_ops storage-class-specifier to static
authorTom Rix <trix@redhat.com>
Sat, 11 Mar 2023 13:51:13 +0000 (08:51 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Sun, 19 Mar 2023 16:20:49 +0000 (12:20 -0400)
smatch reports this warning
kernel/trace/ftrace.c:2594:19: warning:
  symbol 'direct_ops' was not declared. Should it be static?

The variable direct_ops is only used in ftrace.c, so it should be static

Link: https://lore.kernel.org/linux-trace-kernel/20230311135113.711824-1-trix@redhat.com
Signed-off-by: Tom Rix <trix@redhat.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ftrace.c

index a47f7d93e32d24d9cc61fdccf60eb9722a7f38b7..ec2897a760045bc7fb255f2faa530ff360b8c035 100644 (file)
@@ -2503,7 +2503,7 @@ static void call_direct_funcs(unsigned long ip, unsigned long pip,
        arch_ftrace_set_direct_caller(fregs, addr);
 }
 
-struct ftrace_ops direct_ops = {
+static struct ftrace_ops direct_ops = {
        .func           = call_direct_funcs,
        .flags          = FTRACE_OPS_FL_DIRECT | FTRACE_OPS_FL_SAVE_REGS
                          | FTRACE_OPS_FL_PERMANENT,