]> git.baikalelectronics.ru Git - kernel.git/commitdiff
MIPS: cmpxchg: Rearrange __xchg() arguments to match xchg()
authorPaul Burton <paul.burton@imgtec.com>
Sat, 10 Jun 2017 00:26:41 +0000 (17:26 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 29 Jun 2017 00:42:25 +0000 (02:42 +0200)
The __xchg() function declares its first 2 arguments in reverse order
compared to the xchg() macro, which is confusing & serves no purpose.
Reorder the arguments such that __xchg() & xchg() match.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/16356/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/cmpxchg.h

index a633f61c55454130cb1ff24bc3a36868e3442e5c..903f3bf48419cb917dfc15af9013674e45c23017 100644 (file)
@@ -73,7 +73,8 @@ extern unsigned long __xchg_called_with_bad_pointer(void)
 extern unsigned long __xchg_small(volatile void *ptr, unsigned long val,
                                  unsigned int size);
 
-static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
+static inline unsigned long __xchg(volatile void *ptr, unsigned long x,
+                                  int size)
 {
        switch (size) {
        case 1:
@@ -101,7 +102,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
        smp_mb__before_llsc();                                          \
                                                                        \
        __res = (__typeof__(*(ptr)))                                    \
-               __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)));      \
+               __xchg((ptr), (unsigned long)(x), sizeof(*(ptr)));      \
                                                                        \
        smp_llsc_mb();                                                  \
                                                                        \