OSDN Git Service

s390: add type checking to CALL_ON_STACK_NORETURN() macro
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 5 Jul 2021 15:53:42 +0000 (17:53 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 8 Jul 2021 20:12:18 +0000 (22:12 +0200)
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>
arch/s390/include/asm/stacktrace.h

index 1dc9e81..4d4d5df 100644 (file)
@@ -191,12 +191,14 @@ struct stack_frame {
 
 #define CALL_ON_STACK_NORETURN(fn, stack)                              \
 ({                                                                     \
+       void (*__fn)(void) = fn;                                        \
+                                                                       \
        asm volatile(                                                   \
                "       la      15,0(%[_stack])\n"                      \
                "       xc      %[_bc](8,15),%[_bc](15)\n"              \
                "       brasl   14,%[_fn]\n"                            \
                ::[_bc] "i" (offsetof(struct stack_frame, back_chain)), \
-                 [_stack] "a" (stack), [_fn] "X" (fn));                \
+                 [_stack] "a" (stack), [_fn] "X" (__fn));              \
        BUG();                                                          \
 })