Skip to content

Commit cc87b7c

Browse files
committed
modpost: move __attribute__((format(printf, 2, 3))) to modpost.h
This attribute must be added to the function declaration in a header for comprehensive checking of all the callsites. Fixes: 6d9a89e ("kbuild: declare the modpost error functions as printf like") Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]>
1 parent cbe826b commit cc87b7c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/mod/modpost.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ static unsigned int nr_unresolved;
6060

6161
#define MODULE_NAME_LEN (64 - sizeof(Elf_Addr))
6262

63-
void __attribute__((format(printf, 2, 3)))
64-
modpost_log(enum loglevel loglevel, const char *fmt, ...)
63+
void modpost_log(enum loglevel loglevel, const char *fmt, ...)
6564
{
6665
va_list arglist;
6766

scripts/mod/modpost.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ enum loglevel {
197197
LOG_FATAL
198198
};
199199

200-
void modpost_log(enum loglevel loglevel, const char *fmt, ...);
200+
void __attribute__((format(printf, 2, 3)))
201+
modpost_log(enum loglevel loglevel, const char *fmt, ...);
201202

202203
/*
203204
* warn - show the given message, then let modpost continue running, still

0 commit comments

Comments
 (0)