[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251208154846.2901693-1-andriy.shevchenko@linux.intel.com>
Date: Mon, 8 Dec 2025 16:48:46 +0100
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Alexei Starovoitov <ast@...nel.org>,
Kumar Kartikeya Dwivedi <memxor@...il.com>,
Puranjay Mohan <puranjay@...nel.org>,
bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Eduard Zingerman <eddyz87@...il.com>,
Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>,
Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>,
Alan Maguire <alan.maguire@...cle.com>,
Mirsad Todorovac <mtodorovac69@...oo.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v1 1/1] bpf: Mark bpf_stream_vprintk_impl() with __printf() attribute
bpf_stream_vprintk_impl() is using printf() type of format, and compiler
is not happy about them as is:
kernel/bpf/stream.c:241:9: error: function ‘bpf_stream_vprintk_impl’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
241 | ret = bstr_printf(data.buf, MAX_BPRINTF_BUF, fmt__str, data.bin_args);
| ^~~
Fix the compilation errors by adding __printf() attribute.
Fixes: 5ab154f1463a ("bpf: Introduce BPF standard streams")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
kernel/bpf/stream.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/bpf/stream.c b/kernel/bpf/stream.c
index 0b6bc3f30335..4bff72e3c16f 100644
--- a/kernel/bpf/stream.c
+++ b/kernel/bpf/stream.c
@@ -212,6 +212,7 @@ __bpf_kfunc_start_defs();
* Avoid using enum bpf_stream_id so that kfunc users don't have to pull in the
* enum in headers.
*/
+__printf(2, 0)
__bpf_kfunc int bpf_stream_vprintk_impl(int stream_id, const char *fmt__str, const void *args,
u32 len__sz, void *aux__prog)
{
--
2.50.1
Powered by blists - more mailing lists