Skip to content

Commit baaba7b

Browse files
andy-shevpcmoore
authored andcommitted
audit: mark audit_log_vformat() with __printf() attribute
audit_log_vformat() is using printf() type of format, and GCC compiler (Debian 14.2.0-17) is not happy about this: kernel/audit.c:1978:9: error: function ‘audit_log_vformat’ might be a candidate for ‘gnu_printf’ format attribute kernel/audit.c:1987:17: error: function ‘audit_log_vformat’ might be a candidate for ‘gnu_printf’ format attribute Fix the compilation errors (`make W=1` when CONFIG_WERROR=y, which is default) by adding __printf() attribute. Signed-off-by: Andy Shevchenko <[email protected]> [PM: commit description line wrap fixes] Signed-off-by: Paul Moore <[email protected]>
1 parent 0af2f6b commit baaba7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/audit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,8 +1956,8 @@ static inline int audit_expand(struct audit_buffer *ab, int extra)
19561956
* will be called a second time. Currently, we assume that a printk
19571957
* can't format message larger than 1024 bytes, so we don't either.
19581958
*/
1959-
static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
1960-
va_list args)
1959+
static __printf(2, 0)
1960+
void audit_log_vformat(struct audit_buffer *ab, const char *fmt, va_list args)
19611961
{
19621962
int len, avail;
19631963
struct sk_buff *skb;

0 commit comments

Comments
 (0)