W=1 builds fail on kernel/bpf/diagnostics.o with
-Werror=suggest-attribute=format. bpf_diag_source() passes a
printf-style format string to bpf_diag_vfmt(); mark it __printf(4, 5)
like the other diagnostic helpers.
Signed-off-by: Li Ruijian
Co-authored-by: Cursor
---
kernel/bpf/diagnostics.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/bpf/diagnostics.c b/kernel/bpf/diagnostics.c
index 0abbbe177e31..2421f52eec14 100644
--- a/kernel/bpf/diagnostics.c
+++ b/kernel/bpf/diagnostics.c
@@ -794,6 +794,7 @@ static void diag_print_insn_context(struct bpf_verifier_env *env, u32 insn_idx,
}
}
+__printf(4, 5)
static void bpf_diag_source(struct bpf_verifier_env *env, u32 insn_idx, const char *label,
const char *fmt, ...)
{
--
2.43.0