public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing: Fix -Wundef around 'struct event_mod_load'
@ 2025-01-20 12:29 Nathan Chancellor
  2025-01-20 17:36 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2025-01-20 12:29 UTC (permalink / raw)
  To: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers
  Cc: linux-kernel, linux-trace-kernel, llvm, patches,
	kernel test robot, Nathan Chancellor

When CONFIG_MODULES is disabled, clang warns:

  kernel/trace/trace_events.c:872:5: warning: 'CONFIG_MODULES' is not defined, evaluates to 0 [-Wundef]
    872 | #if CONFIG_MODULES
        |     ^

Use '#ifdef' to resolve the warning.

Fixes: b355247df104 ("tracing: Cache ":mod:" events for modules not loaded yet")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501190121.E2CIJuUj-lkp@intel.com/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 kernel/trace/trace_events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index ab04994e4510..de934332ba36 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -869,7 +869,7 @@ static int ftrace_event_enable_disable(struct trace_event_file *file,
 	return __ftrace_event_enable_disable(file, enable, 0);
 }
 
-#if CONFIG_MODULES
+#ifdef CONFIG_MODULES
 struct event_mod_load {
 	struct list_head	list;
 	char			*module;

---
base-commit: 9f3ccaeedbe0088f1b89474bcf4187c49cfe8de2
change-id: 20250120-trace_events-fix-wundef-7a1153105f5f

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


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

* Re: [PATCH] tracing: Fix -Wundef around 'struct event_mod_load'
  2025-01-20 12:29 [PATCH] tracing: Fix -Wundef around 'struct event_mod_load' Nathan Chancellor
@ 2025-01-20 17:36 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2025-01-20 17:36 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Masami Hiramatsu, Mathieu Desnoyers, linux-kernel,
	linux-trace-kernel, llvm, patches, kernel test robot

On Mon, 20 Jan 2025 05:29:24 -0700
Nathan Chancellor <nathan@kernel.org> wrote:

> When CONFIG_MODULES is disabled, clang warns:
> 
>   kernel/trace/trace_events.c:872:5: warning: 'CONFIG_MODULES' is not defined, evaluates to 0 [-Wundef]
>     872 | #if CONFIG_MODULES
>         |     ^
> 
> Use '#ifdef' to resolve the warning.
> 
> Fixes: b355247df104 ("tracing: Cache ":mod:" events for modules not loaded yet")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202501190121.E2CIJuUj-lkp@intel.com/
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Yes yes, I had this fixed locally but never tested nor pushed it out. :-p

Thanks,

-- Steve

> ---
>  kernel/trace/trace_events.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index ab04994e4510..de934332ba36 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -869,7 +869,7 @@ static int ftrace_event_enable_disable(struct trace_event_file *file,
>  	return __ftrace_event_enable_disable(file, enable, 0);
>  }
>  
> -#if CONFIG_MODULES
> +#ifdef CONFIG_MODULES
>  struct event_mod_load {
>  	struct list_head	list;
>  	char			*module;
> 
> ---
> base-commit: 9f3ccaeedbe0088f1b89474bcf4187c49cfe8de2
> change-id: 20250120-trace_events-fix-wundef-7a1153105f5f
> 
> Best regards,


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

end of thread, other threads:[~2025-01-20 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-20 12:29 [PATCH] tracing: Fix -Wundef around 'struct event_mod_load' Nathan Chancellor
2025-01-20 17:36 ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox