linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ftrace: Remove unused ftrace_startup_enable() stub
@ 2022-02-14 19:28 Nathan Chancellor
  2022-02-14 19:50 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2022-02-14 19:28 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar
  Cc: Nick Desaulniers, linux-kernel, llvm, Nathan Chancellor,
	kernel test robot

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.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 kernel/trace/ftrace.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index f9feb197b2da..a4b462b6f944 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -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
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ftrace: Remove unused ftrace_startup_enable() stub
  2022-02-14 19:28 [PATCH] ftrace: Remove unused ftrace_startup_enable() stub Nathan Chancellor
@ 2022-02-14 19:50 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2022-02-14 19:50 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Ingo Molnar, Nick Desaulniers, linux-kernel, llvm, kernel test robot

On Mon, 14 Feb 2022 12:28:47 -0700
Nathan Chancellor <nathan@kernel.org> 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").
> 
> 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.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks,

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

-- Steve

> ---
>  kernel/trace/ftrace.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index f9feb197b2da..a4b462b6f944 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-14 21:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 19:28 [PATCH] ftrace: Remove unused ftrace_startup_enable() stub Nathan Chancellor
2022-02-14 19:50 ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).