[PATCH 2/2] tracing/osnoise: add printf attribute to osnoise_print

From: Arnd Bergmann

Date: Tue Jun 02 2026 - 11:38:05 EST


From: Arnd Bergmann <arnd@xxxxxxxx>

gcc points out that tne newly added function uses printf style arguments
and should get an attribute to allow verifying the format strings for
its callers:

kernel/trace/trace_osnoise.c: In function 'osnoise_print':
kernel/trace/trace_osnoise.c:96:17: error: function 'osnoise_print' might be a candidate for 'gnu_printf' format attribute [-Werror=suggest-attribute=format]
96 | trace_array_vprintk(tr, _RET_IP_, fmt, ap);
| ^~~~~~~~~~~~~~~~~~~

Add the attribute as suggested

Fixes: 9cb99c598643 ("tracing/osnoise: Array printk init and cleanup")
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
kernel/trace/trace_osnoise.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index 1fbd8525ab54..6fa015e57899 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -83,7 +83,7 @@ struct osnoise_instance {

static struct list_head osnoise_instances;

-static void osnoise_print(const char *fmt, ...)
+static __printf(1, 2) void osnoise_print(const char *fmt, ...)
{
struct osnoise_instance *inst;
struct trace_array *tr;
--
2.39.5