Skip to content

Commit

Permalink
modpost: move __attribute__((format(printf, 2, 3))) to modpost.h
Browse files Browse the repository at this point in the history
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 <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
Masahiro Yamada committed Dec 10, 2023
1 parent cbe826b commit cc87b7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion scripts/mod/modpost.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cc87b7c

Please sign in to comment.