Skip to content

Commit 6b2c1e3

Browse files
andy-shevpmladek
authored andcommitted
seq_file: 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: fs/seq_file.c:418:35: error: function ‘seq_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-3-andriy.shevchenko@linux.intel.com Signed-off-by: Petr Mladek <pmladek@suse.com>
1 parent 079a206 commit 6b2c1e3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/linux/seq_file.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ int seq_open_private(struct file *, const struct seq_operations *, int);
181181
int seq_release_private(struct inode *, struct file *);
182182

183183
#ifdef CONFIG_BINARY_PRINTF
184+
__printf(2, 0)
184185
void seq_bprintf(struct seq_file *m, const char *f, const u32 *binary);
185186
#endif
186187

0 commit comments

Comments
 (0)