Skip to content

Commit 079a206

Browse files
andy-shevpmladek
authored andcommitted
seq_buf: Mark binary printing functions with __printf() attribute
Binary printing functions are using printf() type of format, and compiler is not happy about them as is: lib/seq_buf.c:162:17: error: function ‘seq_buf_bprintf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] Fix the compilation errors by adding __printf() attribute. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Kees Cook <kees@kernel.org> Reviewed-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20250321144822.324050-2-andriy.shevchenko@linux.intel.com Signed-off-by: Petr Mladek <pmladek@suse.com>
1 parent 9605081 commit 079a206

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/seq_buf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ extern int seq_buf_hex_dump(struct seq_buf *s, const char *prefix_str,
167167
const void *buf, size_t len, bool ascii);
168168

169169
#ifdef CONFIG_BINARY_PRINTF
170-
extern int
171-
seq_buf_bprintf(struct seq_buf *s, const char *fmt, const u32 *binary);
170+
__printf(2, 0)
171+
int seq_buf_bprintf(struct seq_buf *s, const char *fmt, const u32 *binary);
172172
#endif
173173

174174
void seq_buf_do_printk(struct seq_buf *s, const char *lvl);

0 commit comments

Comments
 (0)