Skip to content

Commit a9b6608

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390: add type checking to CALL_ON_STACK_NORETURN() macro
Make sure the to be called function takes no arguments (and returns void). Otherwise usage of CALL_ON_STACK_NORETURN() would generate broken code. Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 60a4813 commit a9b6608

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

arch/s390/include/asm/stacktrace.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,14 @@ struct stack_frame {
191191

192192
#define CALL_ON_STACK_NORETURN(fn, stack) \
193193
({ \
194+
void (*__fn)(void) = fn; \
195+
\
194196
asm volatile( \
195197
" la 15,0(%[_stack])\n" \
196198
" xc %[_bc](8,15),%[_bc](15)\n" \
197199
" brasl 14,%[_fn]\n" \
198200
::[_bc] "i" (offsetof(struct stack_frame, back_chain)), \
199-
[_stack] "a" (stack), [_fn] "X" (fn)); \
201+
[_stack] "a" (stack), [_fn] "X" (__fn)); \
200202
BUG(); \
201203
})
202204

0 commit comments

Comments
 (0)