ftrace: set direct_ops storage-class-specifier to static
PATCH 1/1 ftrace: set direct_ops storage-class-specifier to static
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
--- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ftrace.c +1 -1
@@ -2591,7 +2591,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 ,
Signature · 1 line
2.27.0
Quoted 7 lines · On Sat, 11 Mar 2023 08:51:13 -0500 Tom Rix <[email protected]> wrote:
smatch reports this warning
kernel/trace/ftrace.c:2594:19: warning:
symbol 'direct_ops' was not declared. Should it be static?The variable
direct_opsis only used inftrace.c, so it should be staticSigned-off-by Tom Rix <[email protected]>
This looks good to me.
Thank you!
Quoted 20 lines
--- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/trace/ftrace.c +1
-1@@ -2591,7 +2591,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 ,Signature · 1 line
2.27.0
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
Quoted 7 lines · Tom Rix
smatch reports this warning
kernel/trace/ftrace.c:2594:19: warning:
symbol 'direct_ops' was not declared. Should it be static?The variable
direct_opsis only used inftrace.c, so it should be staticSigned-off-by Tom Rix <[email protected]>
This makes sense, and as this stands:
... but Florent's rework of the API is going to remove this anyway:
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/
... so if we take Florent's series, this patch isn't necessary.
Mark.
Quoted 20 lines
--- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/trace/ftrace.c +1
-1@@ -2591,7 +2591,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 ,Signature · 1 line
2.27.0
Steven Rostedt
maintainerQuoted 11 lines · On Mon, 20 Mar 2023 17:44:13 +0000 Mark Rutland <[email protected]> wrote:
Quoted 7 lines · Tom Rix
smatch reports this warning
kernel/trace/ftrace.c:2594:19: warning:
symbol 'direct_ops' was not declared. Should it be static?The variable
direct_opsis only used inftrace.c, so it should be staticSigned-off-by Tom Rix <[email protected]>This makes sense, and as this stands:
Quoted 8 lines
Acked-by Mark Rutland <[email protected]>... but Florent's rework of the API is going to remove this anyway:
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/... so if we take Florent's series, this patch isn't necessary.
Except that it's already upstream:
I had to rebase Florent's patch to accommodate this change.
-- Steve
Mark Rutland
reviewerQuoted 20 lines · Steven Rostedt
Quoted 18 lines · On Mon, 20 Mar 2023 17:44:13 +0000 Mark Rutland <[email protected]> wrote:
Quoted 7 lines · Tom Rix
smatch reports this warning
kernel/trace/ftrace.c:2594:19: warning:
symbol 'direct_ops' was not declared. Should it be static?The variable
direct_opsis only used inftrace.c, so it should be staticSigned-off-by Tom Rix <[email protected]>This makes sense, and as this stands:
Acked-by Mark Rutland <[email protected]>... but Florent's rework of the API is going to remove this anyway:
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/
Quoted 7 lines
Quoted 1 line
... so if we take Florent's series, this patch isn't necessary.
Except that it's already upstream:
I had to rebase Florent's patch to accommodate this change.
Sorry for the noise; my fault for being so far behind with patch review!
Mark.