diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2024-08-16 22:44:29 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2024-09-01 20:34:50 +0900 |
commit | 4079fe8e7b2b42b278e77dae7cb9d95e62c415a2 (patch) | |
tree | ea85c2f287d2998641165559e764e17ea3979613 /scripts/mod/modpost.h | |
parent | 5b000f3cbb38c23992ee95fcd3e983ca66164eff (diff) |
modpost: simplify modpost_log()
With commit cda5f94e88b4 ("modpost: avoid using the alias attribute"),
only two log levels remain: LOG_WARN and LOG_ERROR. Simplify this by
making it a boolean variable.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'scripts/mod/modpost.h')
-rw-r--r-- | scripts/mod/modpost.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 7fa8bdd801a9..ada3a36cc4bc 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h @@ -182,13 +182,8 @@ char *read_text_file(const char *filename); char *get_line(char **stringp); void *sym_get_data(const struct elf_info *info, const Elf_Sym *sym); -enum loglevel { - LOG_WARN, - LOG_ERROR, -}; - void __attribute__((format(printf, 2, 3))) -modpost_log(enum loglevel loglevel, const char *fmt, ...); +modpost_log(bool is_error, const char *fmt, ...); /* * warn - show the given message, then let modpost continue running, still @@ -203,6 +198,6 @@ modpost_log(enum loglevel loglevel, const char *fmt, ...); * fatal - show the given message, and bail out immediately. This should be * used when there is no point to continue running modpost. */ -#define warn(fmt, args...) modpost_log(LOG_WARN, fmt, ##args) -#define error(fmt, args...) modpost_log(LOG_ERROR, fmt, ##args) +#define warn(fmt, args...) modpost_log(false, fmt, ##args) +#define error(fmt, args...) modpost_log(true, fmt, ##args) #define fatal(fmt, args...) do { error(fmt, ##args); exit(1); } while (1) |