public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>,
	 Masami Hiramatsu <mhiramat@kernel.org>,
	 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	 llvm@lists.linux.dev, patches@lists.linux.dev,
	 kernel test robot <lkp@intel.com>,
	Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH] tracing: Fix -Wundef around 'struct event_mod_load'
Date: Mon, 20 Jan 2025 05:29:24 -0700	[thread overview]
Message-ID: <20250120-trace_events-fix-wundef-v1-1-61259cbbaa75@kernel.org> (raw)

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>


             reply	other threads:[~2025-01-20 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-20 12:29 Nathan Chancellor [this message]
2025-01-20 17:36 ` [PATCH] tracing: Fix -Wundef around 'struct event_mod_load' Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250120-trace_events-fix-wundef-v1-1-61259cbbaa75@kernel.org \
    --to=nathan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox