mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: "Masami Hiramatsu" <mhiramat@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Adrián García Casado" <adriangarciacasado42@gmail.com>
Subject: [for-next][PATCH 6/6] tracing/osnoise: Add __printf attribute to osnoise_print()
Date: Tue, 20 Oct 2026 08:20:02 -0400	[thread overview]
Message-ID: <20261020122011.676328446@kernel.org> (raw)
In-Reply-To: <20261020121956.600452831@kernel.org>

Building kernel/trace/trace_osnoise.o with W=1 triggers the following
compiler warning:

  kernel/trace/trace_osnoise.c:96:17: warning: function 'osnoise_print'
  might be a candidate for 'gnu_printf' format attribute
  [-Wsuggest-attribute=format]

osnoise_print() forwards its format string and va_list arguments to
trace_array_vprintk(), which is annotated with __printf(3, 0).

Add the __printf(1, 2) attribute to osnoise_print() to silence the W=1
warning and enable compile-time format string checking for its callers.

Link: https://patch.msgid.link/20261019205344.190022-1-adriangarciacasado42@gmail.com
Signed-off-by: Adrián García Casado <adriangarciacasado42@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_osnoise.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index 0e1265acd1cc..995da9e0b548 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -83,6 +83,7 @@ struct osnoise_instance {
 
 static struct list_head osnoise_instances;
 
+__printf(1, 2)
 static void osnoise_print(const char *fmt, ...)
 {
 	struct osnoise_instance *inst;
-- 
2.53.0

      parent reply	other threads:[~2026-10-20 12:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 12:19 [for-next][PATCH 0/6] tracing: Updates for 7.4 Steven Rostedt
2026-10-20 12:19 ` [for-next][PATCH 1/6] tracing/syscalls: Use copy_from_user for the faultable syscall buffer Steven Rostedt
2026-10-20 12:19 ` [for-next][PATCH 2/6] tracing: Hold trace_types_lock when updating modules in persistent instances Steven Rostedt
2026-10-20 12:19 ` [for-next][PATCH 3/6] tracing: Hold trace_types_lock when resetting last boot data from readers Steven Rostedt
2026-10-20 12:20 ` [for-next][PATCH 4/6] tracing: Save the event file instead of the compatible histogram Steven Rostedt
2026-10-20 12:20 ` [for-next][PATCH 5/6] tracing/histograms: Verify event_call identity when updating synth_event refcount Steven Rostedt
2026-10-20 12:20 ` Steven Rostedt [this message]

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=20261020122011.676328446@kernel.org \
    --to=rostedt@kernel.org \
    --cc=adriangarciacasado42@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.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

all inboxes | Powered by JetHome®