]> Git Repo - linux.git/commitdiff
MIPS: include: Mark __cmpxchg as __always_inline
authorThomas Bogendoerfer <[email protected]>
Sun, 6 Oct 2019 13:12:32 +0000 (15:12 +0200)
committerPaul Burton <[email protected]>
Mon, 7 Oct 2019 16:37:01 +0000 (09:37 -0700)
Commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly") allows compiler to uninline functions marked as 'inline'.
In cace of cmpxchg this would cause to reference function
__cmpxchg_called_with_bad_pointer, which is a error case
for catching bugs and will not happen for correct code, if
__cmpxchg is inlined.

Signed-off-by: Thomas Bogendoerfer <[email protected]>
[[email protected]: s/__cmpxchd/__cmpxchg in subject]
Signed-off-by: Paul Burton <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: James Hogan <[email protected]>
Cc: [email protected]
Cc: [email protected]
arch/mips/include/asm/cmpxchg.h

index 79bf34efbc04bb7061483f2e43d9fccb94263d68..012dcf7046ad4fdb59cf4758f85a4a704d62704d 100644 (file)
@@ -153,8 +153,9 @@ static inline unsigned long __xchg(volatile void *ptr, unsigned long x,
 extern unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old,
                                     unsigned long new, unsigned int size);
 
-static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-                                     unsigned long new, unsigned int size)
+static __always_inline
+unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
+                       unsigned long new, unsigned int size)
 {
        switch (size) {
        case 1:
This page took 0.058095 seconds and 4 git commands to generate.