s390/cmpxchg: use compiler builtins
[firefly-linux-kernel-4.4.55.git] / arch / s390 / include / asm / spinlock.h
index d6bdf906caa533231660113144c74861ef031e6c..0e37cd0412419ffeb870a8e7f0c51c5ca2833b5f 100644 (file)
@@ -18,14 +18,7 @@ extern int spin_retry;
 static inline int
 _raw_compare_and_swap(unsigned int *lock, unsigned int old, unsigned int new)
 {
-       unsigned int old_expected = old;
-
-       asm volatile(
-               "       cs      %0,%3,%1"
-               : "=d" (old), "=Q" (*lock)
-               : "0" (old), "d" (new), "Q" (*lock)
-               : "cc", "memory" );
-       return old == old_expected;
+       return __sync_bool_compare_and_swap(lock, old, new);
 }
 
 /*