]> git.itanic.dy.fi Git - linux-stable/commitdiff
modpost: move __attribute__((format(printf, 2, 3))) to modpost.h
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 3 Dec 2023 09:49:31 +0000 (18:49 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sun, 10 Dec 2023 06:34:37 +0000 (15:34 +0900)
This attribute must be added to the function declaration in a header
for comprehensive checking of all the callsites.

Fixes: 6d9a89ea4b06 ("kbuild: declare the modpost error functions as printf like")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
scripts/mod/modpost.c
scripts/mod/modpost.h

index cb6406f485a960041db048a5f5e8ae5bfad40bb5..ca0a90158f85c71ba543ce133d65c26024074821 100644 (file)
@@ -60,8 +60,7 @@ static unsigned int nr_unresolved;
 
 #define MODULE_NAME_LEN (64 - sizeof(Elf_Addr))
 
-void __attribute__((format(printf, 2, 3)))
-modpost_log(enum loglevel loglevel, const char *fmt, ...)
+void modpost_log(enum loglevel loglevel, const char *fmt, ...)
 {
        va_list arglist;
 
index 69baf014da4fdaa25989716f7686fadc43b8a603..9fe974dc1a52878882ae913843e528ae46298a38 100644 (file)
@@ -197,7 +197,8 @@ enum loglevel {
        LOG_FATAL
 };
 
-void modpost_log(enum loglevel loglevel, const char *fmt, ...);
+void __attribute__((format(printf, 2, 3)))
+modpost_log(enum loglevel loglevel, const char *fmt, ...);
 
 /*
  * warn - show the given message, then let modpost continue running, still