Skip to content

Commit 264a750

Browse files
jognesspmladek
authored andcommitted
printk: use gnu_printf format attribute for printk_sprint()
Fix the following W=1 kernel build warning: kernel/printk/printk.c: In function 'printk_sprint': kernel/printk/printk.c:1913:9: warning: function 'printk_sprint' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] Reported-by: kernel test robot <[email protected]> Signed-off-by: John Ogness <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5aa7eea commit 264a750

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/printk/printk.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,6 +2066,7 @@ u16 printk_parse_prefix(const char *text, int *level,
20662066
return prefix_len;
20672067
}
20682068

2069+
__printf(5, 0)
20692070
static u16 printk_sprint(char *text, u16 size, int facility,
20702071
enum printk_info_flags *flags, const char *fmt,
20712072
va_list args)

0 commit comments

Comments
 (0)