bpf: add missing __printf attribute to bpf_diag_source
PATCH 1/1 bpf: add missing __printf attribute to bpf_diag_source
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 <[email protected]>
Co-authored-by Cursor <[email protected]>
--- kernel/bpf/diagnostics.c | 1 + 1 file changed, 1 insertion(+)
kernel/bpf/diagnostics.c +1 -0
@@ -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, ...) {
Signature · 1 line
2.43.0
PATCH v2 1/1 bpf: add missing __printf attribute to bpf_diag_source
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 <[email protected]>
--- kernel/bpf/diagnostics.c | 1 + 1 file changed, 1 insertion(+)
v2:
- drop accidental Co-authored-by trailer from v1
kernel/bpf/diagnostics.c +1 -0
@@ -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, ...) {
Signature · 1 line
2.43.0