[PATCH] tracing/osnoise: Add __printf attribute to osnoise_print()

From
Adrián García Casado <hidden>
Date
2026-10-19 20:53:58
Also in
lkml
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.

Signed-off-by: Adrián García Casado <redacted>
---
 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 0e1265acd1..995da9e0b5 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.39.5
Thread (2 messages) 2 messages, 1 author, 15d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help