Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

modpost: inform compilers that fatal() never returns

The function fatal() never returns because modpost_log() calls exit(1)
when LOG_FATAL is passed.

Inform compilers of this fact so that unreachable code flow can be
identified at compile time.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>

+7 -1
+3
scripts/mod/modpost.c
··· 90 90 error_occurred = true; 91 91 } 92 92 93 + void __attribute__((alias("modpost_log"))) 94 + modpost_log_noret(enum loglevel loglevel, const char *fmt, ...); 95 + 93 96 static inline bool strends(const char *str, const char *postfix) 94 97 { 95 98 if (strlen(str) < strlen(postfix))
+4 -1
scripts/mod/modpost.h
··· 200 200 void __attribute__((format(printf, 2, 3))) 201 201 modpost_log(enum loglevel loglevel, const char *fmt, ...); 202 202 203 + void __attribute__((format(printf, 2, 3), noreturn)) 204 + modpost_log_noret(enum loglevel loglevel, const char *fmt, ...); 205 + 203 206 /* 204 207 * warn - show the given message, then let modpost continue running, still 205 208 * allowing modpost to exit successfully. This should be used when ··· 218 215 */ 219 216 #define warn(fmt, args...) modpost_log(LOG_WARN, fmt, ##args) 220 217 #define error(fmt, args...) modpost_log(LOG_ERROR, fmt, ##args) 221 - #define fatal(fmt, args...) modpost_log(LOG_FATAL, fmt, ##args) 218 + #define fatal(fmt, args...) modpost_log_noret(LOG_FATAL, fmt, ##args)