Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'printk-for-6.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux

Pull more printk updates from Petr Mladek:

- Silence warnings about candidates for ‘gnu_print’ format attribute

* tag 'printk-for-6.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
vsnprintf: Silence false positive GCC warning for va_format()
vsnprintf: Drop unused const char fmt * in va_format()
vsnprintf: Mark binary printing functions with __printf() attribute
tracing: Mark binary printing functions with __printf() attribute
seq_file: Mark binary printing functions with __printf() attribute
seq_buf: Mark binary printing functions with __printf() attribute

+30 -27
+2 -2
include/linux/seq_buf.h
··· 167 167 const void *buf, size_t len, bool ascii); 168 168 169 169 #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); 172 172 #endif 173 173 174 174 void seq_buf_do_printk(struct seq_buf *s, const char *lvl);
+1
include/linux/seq_file.h
··· 181 181 int seq_release_private(struct inode *, struct file *); 182 182 183 183 #ifdef CONFIG_BINARY_PRINTF 184 + __printf(2, 0) 184 185 void seq_bprintf(struct seq_file *m, const char *f, const u32 *binary); 185 186 #endif 186 187
+2 -2
include/linux/string.h
··· 336 336 #define sysfs_match_string(_a, _s) __sysfs_match_string(_a, ARRAY_SIZE(_a), _s) 337 337 338 338 #ifdef CONFIG_BINARY_PRINTF 339 - int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); 340 - int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf); 339 + __printf(3, 0) int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); 340 + __printf(3, 0) int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf); 341 341 #endif 342 342 343 343 extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
+2 -2
include/linux/trace.h
··· 72 72 static inline void trace_printk_init_buffers(void) 73 73 { 74 74 } 75 - static inline int trace_array_printk(struct trace_array *tr, unsigned long ip, 76 - const char *fmt, ...) 75 + static inline __printf(3, 4) 76 + int trace_array_printk(struct trace_array *tr, unsigned long ip, const char *fmt, ...) 77 77 { 78 78 return 0; 79 79 }
+4 -4
include/linux/trace_seq.h
··· 88 88 void trace_seq_printf(struct trace_seq *s, const char *fmt, ...); 89 89 extern __printf(2, 0) 90 90 void trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args); 91 - extern void 92 - trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); 91 + extern __printf(2, 0) 92 + void trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); 93 93 extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); 94 94 extern int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, 95 95 int cnt); ··· 113 113 void trace_seq_printf(struct trace_seq *s, const char *fmt, ...) 114 114 { 115 115 } 116 - static inline void 117 - trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) 116 + static inline __printf(2, 0) 117 + void trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) 118 118 { 119 119 } 120 120
+3 -8
kernel/trace/trace.c
··· 3341 3341 } 3342 3342 EXPORT_SYMBOL_GPL(trace_vbprintk); 3343 3343 3344 - __printf(3, 0) 3345 - static int 3346 - __trace_array_vprintk(struct trace_buffer *buffer, 3347 - unsigned long ip, const char *fmt, va_list args) 3344 + static __printf(3, 0) 3345 + int __trace_array_vprintk(struct trace_buffer *buffer, 3346 + unsigned long ip, const char *fmt, va_list args) 3348 3347 { 3349 3348 struct ring_buffer_event *event; 3350 3349 int len = 0, size; ··· 3393 3394 return len; 3394 3395 } 3395 3396 3396 - __printf(3, 0) 3397 3397 int trace_array_vprintk(struct trace_array *tr, 3398 3398 unsigned long ip, const char *fmt, va_list args) 3399 3399 { ··· 3422 3424 * Note, trace_array_init_printk() must be called on @tr before this 3423 3425 * can be used. 3424 3426 */ 3425 - __printf(3, 0) 3426 3427 int trace_array_printk(struct trace_array *tr, 3427 3428 unsigned long ip, const char *fmt, ...) 3428 3429 { ··· 3466 3469 } 3467 3470 EXPORT_SYMBOL_GPL(trace_array_init_printk); 3468 3471 3469 - __printf(3, 4) 3470 3472 int trace_array_printk_buf(struct trace_buffer *buffer, 3471 3473 unsigned long ip, const char *fmt, ...) 3472 3474 { ··· 3481 3485 return ret; 3482 3486 } 3483 3487 3484 - __printf(2, 0) 3485 3488 int trace_vprintk(unsigned long ip, const char *fmt, va_list args) 3486 3489 { 3487 3490 return trace_array_vprintk(printk_trace, ip, fmt, args);
+9 -7
kernel/trace/trace.h
··· 852 852 853 853 extern void *head_page(struct trace_array_cpu *data); 854 854 extern unsigned long long ns2usecs(u64 nsec); 855 - extern int 856 - trace_vbprintk(unsigned long ip, const char *fmt, va_list args); 857 - extern int 858 - trace_vprintk(unsigned long ip, const char *fmt, va_list args); 859 - extern int 860 - trace_array_vprintk(struct trace_array *tr, 861 - unsigned long ip, const char *fmt, va_list args); 855 + 856 + __printf(2, 0) 857 + int trace_vbprintk(unsigned long ip, const char *fmt, va_list args); 858 + __printf(2, 0) 859 + int trace_vprintk(unsigned long ip, const char *fmt, va_list args); 860 + __printf(3, 0) 861 + int trace_array_vprintk(struct trace_array *tr, 862 + unsigned long ip, const char *fmt, va_list args); 863 + __printf(3, 4) 862 864 int trace_array_printk_buf(struct trace_buffer *buffer, 863 865 unsigned long ip, const char *fmt, ...); 864 866 void trace_printk_seq(struct trace_seq *s);
+7 -2
lib/vsprintf.c
··· 1699 1699 return buf; 1700 1700 } 1701 1701 1702 + #pragma GCC diagnostic push 1703 + #ifndef __clang__ 1704 + #pragma GCC diagnostic ignored "-Wsuggest-attribute=format" 1705 + #endif 1702 1706 static char *va_format(char *buf, char *end, struct va_format *va_fmt, 1703 - struct printf_spec spec, const char *fmt) 1707 + struct printf_spec spec) 1704 1708 { 1705 1709 va_list va; 1706 1710 ··· 1717 1713 1718 1714 return buf; 1719 1715 } 1716 + #pragma GCC diagnostic pop 1720 1717 1721 1718 static noinline_for_stack 1722 1719 char *uuid_string(char *buf, char *end, const u8 *addr, ··· 2471 2466 case 'U': 2472 2467 return uuid_string(buf, end, ptr, spec, fmt); 2473 2468 case 'V': 2474 - return va_format(buf, end, ptr, spec, fmt); 2469 + return va_format(buf, end, ptr, spec); 2475 2470 case 'K': 2476 2471 return restricted_pointer(buf, end, ptr, spec); 2477 2472 case 'N':