Skip to content

Commit a637b3b

Browse files
committed
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 <[email protected]> Link: https://lore.kernel.org/linux-mm/[email protected]/ Fixes: d2b1f6d ("s390/cmpxchg: get rid of gcc atomic builtins") Signed-off-by: Heiko Carstens <[email protected]>
1 parent b44913f commit a637b3b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

arch/s390/include/asm/cmpxchg.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
void __xchg_called_with_bad_pointer(void);
1616

17-
static inline unsigned long __xchg(unsigned long x, unsigned long address, int size)
17+
static __always_inline unsigned long __xchg(unsigned long x,
18+
unsigned long address, int size)
1819
{
1920
unsigned long old;
2021
int shift;
@@ -83,8 +84,9 @@ static inline unsigned long __xchg(unsigned long x, unsigned long address, int s
8384

8485
void __cmpxchg_called_with_bad_pointer(void);
8586

86-
static inline unsigned long __cmpxchg(unsigned long address, unsigned long old,
87-
unsigned long new, int size)
87+
static __always_inline unsigned long __cmpxchg(unsigned long address,
88+
unsigned long old,
89+
unsigned long new, int size)
8890
{
8991
unsigned long prev, tmp;
9092
int shift;

0 commit comments

Comments
 (0)