Skip to contentSkip to conversation

ftrace: Remove unused ftrace_startup_enable() stub

PATCH In review Nathan Chancellor 2 participants 2 messages Feb 14, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ftrace: Remove unused ftrace_startup_enable() stub

When building with clang + CONFIG_DYNAMIC_FTRACE=n + W=1, there is a warning:

kernel/trace/ftrace.c:7194:20: error: unused function 'ftrace_startup_enable' [-Werror,-Wunused-function] static inline void ftrace_startup_enable(int command) { }

                     ^

1 error generated.

Clang warns on instances of static inline functions in .c files with W=1 after commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build").

The ftrace_startup_enable() stub has been unused since commit e1effa0144a1 ("ftrace: Annotate the ops operation on update"), where its use outside of the CONFIG_DYNAMIC_TRACE section was replaced by ftrace_startup_all(). Remove it to resolve the warning.

---
 kernel/trace/ftrace.c | 1 -
 1 file changed, 1 deletion(-)
kernel/trace/ftrace.c +0 -1
index f9feb197b2da..a4b462b6f944 100644
@@ -7191,7 +7191,6 @@ static int __init ftrace_nodyn_init(void)
 core_initcall(ftrace_nodyn_init);
 
 static inline int ftrace_init_dyn_tracefs(struct dentry *d_tracer) { return 0; }
-static inline void ftrace_startup_enable(int command) { }
 static inline void ftrace_startup_all(int command) { }
 
 # define ftrace_startup_sysctl()	do { } while (0)

base-commit: 754e0b0e35608ed5206d6a67a791563c631cec07

Signature · 1 line
2.35.1
maintainer
#1 lore raw
Quoted 12 lines · On Mon, 14 Feb 2022 12:28:47 -0700 Nathan Chancellor <[email protected]> wrote:

When building with clang + CONFIG_DYNAMIC_FTRACE=n + W=1, there is a warning:

kernel/trace/ftrace.c:7194:20: error: unused function 'ftrace_startup_enable' [-Werror,-Wunused-function] static inline void ftrace_startup_enable(int command) { }

                     ^

1 error generated.

Clang warns on instances of static inline functions in .c files with W=1 after commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build").

Quoted 7 lines

The ftrace_startup_enable() stub has been unused since commit e1effa0144a1 ("ftrace: Annotate the ops operation on update"), where its use outside of the CONFIG_DYNAMIC_TRACE section was replaced by ftrace_startup_all(). Remove it to resolve the warning.

Thanks,

I'll queue this up for the next merge window. (After it passes all my testing of course).

-- Steve

Quoted 18 lines
---
 kernel/trace/ftrace.c | 1 -
 1 file changed, 1 deletion(-)
kernel/trace/ftrace.c +0 -1
index f9feb197b2da..a4b462b6f944 100644
@@ -7191,7 +7191,6 @@ static int __init ftrace_nodyn_init(void)
 core_initcall(ftrace_nodyn_init);
 
 static inline int ftrace_init_dyn_tracefs(struct dentry *d_tracer) { return 0; }
-static inline void ftrace_startup_enable(int command) { }
 static inline void ftrace_startup_all(int command) { }
 
 # define ftrace_startup_sysctl()	do { } while (0)

base-commit: 754e0b0e35608ed5206d6a67a791563c631cec07