From: Heiko Carstens Date: Sat, 17 Apr 2021 12:48:32 +0000 (+0200) Subject: s390/atomic,cmpxchg: always inline __xchg/__cmpxchg X-Git-Tag: io_uring-5.13-2021-05-07~47^2~4 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=a637b3bfa43aead7221b79cd92e092ef911c8253;p=linux-2.6-block.git s390/atomic,cmpxchg: always inline __xchg/__cmpxchg Make sure to always inline __xchg() and __cmpxchg() otherwise the compiler might decide to generate out-of-line versions which will fail at link time: s390-linux-ld: lib/atomic64_test.o: in function `__xchg': >> atomic64_test.c:(.text.unlikely+0xa4): undefined reference to `__xchg_called_with_bad_pointer' Reported-by: kernel test robot Link: https://lore.kernel.org/linux-mm/202104170449.SIIFKVjT-lkp@intel.com/ Fixes: d2b1f6d2d350 ("s390/cmpxchg: get rid of gcc atomic builtins") Signed-off-by: Heiko Carstens --- diff --git a/arch/s390/include/asm/cmpxchg.h b/arch/s390/include/asm/cmpxchg.h index e1eb65fceef2..1960a7295ae5 100644 --- a/arch/s390/include/asm/cmpxchg.h +++ b/arch/s390/include/asm/cmpxchg.h @@ -14,7 +14,8 @@ void __xchg_called_with_bad_pointer(void); -static inline unsigned long __xchg(unsigned long x, unsigned long address, int size) +static __always_inline unsigned long __xchg(unsigned long x, + unsigned long address, int size) { unsigned long old; int shift; @@ -83,8 +84,9 @@ static inline unsigned long __xchg(unsigned long x, unsigned long address, int s void __cmpxchg_called_with_bad_pointer(void); -static inline unsigned long __cmpxchg(unsigned long address, unsigned long old, - unsigned long new, int size) +static __always_inline unsigned long __cmpxchg(unsigned long address, + unsigned long old, + unsigned long new, int size) { unsigned long prev, tmp; int shift;