Skip to content

Commit cd6a579

Browse files
committed
spl/lua: restore noreturn annotations
Objtool correctly complains that `spl_panic()` and `luaD_throw()` are missing an `atribute((noreturn))` annotation. They were in place but removed in a previous commit to work around spurious objtool warnings they caused. Add them back in, the spurious warnings are addressed in a separate commit. Signed-off-by: Attila Fülöp <attila@fueloep.org>
1 parent 46b82de commit cd6a579

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

include/os/linux/spl/sys/debug.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,7 @@
6969
#define __maybe_unused __attribute__((unused))
7070
#endif
7171

72-
/*
73-
* Without this, we see warnings from objtool during normal Linux builds when
74-
* the kernel is built with CONFIG_STACK_VALIDATION=y:
75-
*
76-
* warning: objtool: tsd_create() falls through to next function __list_add()
77-
* warning: objtool: .text: unexpected end of section
78-
*
79-
* Until the toolchain stops doing this, we must only define this attribute on
80-
* spl_panic() when doing static analysis.
81-
*/
82-
#if defined(__COVERITY__) || defined(__clang_analyzer__)
8372
__attribute__((__noreturn__))
84-
#endif
8573
extern void spl_panic(const char *file, const char *func, int line,
8674
const char *fmt, ...);
8775
extern void spl_dumpstack(void);

module/lua/llimits.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ typedef LUAI_UACNUMBER l_uacNumber;
9797

9898
/*
9999
** non-return type
100-
**
101-
** Suppress noreturn attribute in kernel builds to avoid objtool check warnings
102100
*/
103-
#if defined(__GNUC__) && !defined(_KERNEL)
101+
#if defined(__GNUC__) || defined(__clang__) /* XXX separate change? test! */
104102
#define l_noret void __attribute__((noreturn))
105103
#elif defined(_MSC_VER)
106104
#define l_noret void __declspec(noreturn)

module/os/linux/spl/spl-err.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ spl_dumpstack(void)
4545
}
4646
EXPORT_SYMBOL(spl_dumpstack);
4747

48+
__attribute__((__noreturn__))
4849
void
4950
spl_panic(const char *file, const char *func, int line, const char *fmt, ...)
5051
{

0 commit comments

Comments
 (0)