asm-generic: cmpxchg does not handle non-long arguments

The version of cmpxchg defined in asm-generic/system.h does not handle
correctly non-long arguments. Use the version defined in cmpxchg.h
instead.

Signed-off-by: Mathieu Lacage <mathieu.lacage@inria.fr>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by Mathieu Lacage and committed by Arnd Bergmann c6691126 8b9d4069

+1 -19
+1 -19
include/asm-generic/system.h
··· 21 21 #include <linux/irqflags.h> 22 22 23 23 #include <asm/cmpxchg-local.h> 24 + #include <asm/cmpxchg.h> 24 25 25 26 struct task_struct; 26 27 ··· 136 135 137 136 #define xchg(ptr, x) \ 138 137 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) 139 - 140 - static inline unsigned long __cmpxchg(volatile unsigned long *m, 141 - unsigned long old, unsigned long new) 142 - { 143 - unsigned long retval; 144 - unsigned long flags; 145 - 146 - local_irq_save(flags); 147 - retval = *m; 148 - if (retval == old) 149 - *m = new; 150 - local_irq_restore(flags); 151 - return retval; 152 - } 153 - 154 - #define cmpxchg(ptr, o, n) \ 155 - ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \ 156 - (unsigned long)(o), \ 157 - (unsigned long)(n))) 158 138 159 139 #endif /* !__ASSEMBLY__ */ 160 140