]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/atomic: Remove __atomic_cmpxchg() variants
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 6 Nov 2024 10:03:16 +0000 (11:03 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 12 Nov 2024 13:01:29 +0000 (14:01 +0100)
With users converted to the standard arch_cmpxchg() variants, remove
the now unused __atomic_cmpxchg() and __atomic_cmpxchg_bool() variants.

Reviewed-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/atomic_ops.h

index 65380da9e75f3ee8f57aefa1b0dade98172957fd..1d6b2056fad8543e92b73dd758e06b03cd80d442 100644 (file)
@@ -169,79 +169,4 @@ __ATOMIC64_OPS(__atomic64_xor, "xgr")
 
 #endif /* MARCH_HAS_Z196_FEATURES */
 
-static __always_inline int __atomic_cmpxchg(int *ptr, int old, int new)
-{
-       asm volatile(
-               "       cs      %[old],%[new],%[ptr]"
-               : [old] "+d" (old), [ptr] "+Q" (*ptr)
-               : [new] "d" (new)
-               : "cc", "memory");
-       return old;
-}
-
-static __always_inline long __atomic64_cmpxchg(long *ptr, long old, long new)
-{
-       asm volatile(
-               "       csg     %[old],%[new],%[ptr]"
-               : [old] "+d" (old), [ptr] "+QS" (*ptr)
-               : [new] "d" (new)
-               : "cc", "memory");
-       return old;
-}
-
-/* GCC versions before 14.2.0 may die with an ICE in some configurations. */
-#if defined(__GCC_ASM_FLAG_OUTPUTS__) && !(IS_ENABLED(CONFIG_CC_IS_GCC) && (GCC_VERSION < 140200))
-
-static __always_inline bool __atomic_cmpxchg_bool(int *ptr, int old, int new)
-{
-       int cc;
-
-       asm volatile(
-               "       cs      %[old],%[new],%[ptr]"
-               : [old] "+d" (old), [ptr] "+Q" (*ptr), "=@cc" (cc)
-               : [new] "d" (new)
-               : "memory");
-       return cc == 0;
-}
-
-static __always_inline bool __atomic64_cmpxchg_bool(long *ptr, long old, long new)
-{
-       int cc;
-
-       asm volatile(
-               "       csg     %[old],%[new],%[ptr]"
-               : [old] "+d" (old), [ptr] "+QS" (*ptr), "=@cc" (cc)
-               : [new] "d" (new)
-               : "memory");
-       return cc == 0;
-}
-
-#else /* __GCC_ASM_FLAG_OUTPUTS__ */
-
-static __always_inline bool __atomic_cmpxchg_bool(int *ptr, int old, int new)
-{
-       int old_expected = old;
-
-       asm volatile(
-               "       cs      %[old],%[new],%[ptr]"
-               : [old] "+d" (old), [ptr] "+Q" (*ptr)
-               : [new] "d" (new)
-               : "cc", "memory");
-       return old == old_expected;
-}
-
-static __always_inline bool __atomic64_cmpxchg_bool(long *ptr, long old, long new)
-{
-       long old_expected = old;
-
-       asm volatile(
-               "       csg     %[old],%[new],%[ptr]"
-               : [old] "+d" (old), [ptr] "+QS" (*ptr)
-               : [new] "d" (new)
-               : "cc", "memory");
-       return old == old_expected;
-}
-
-#endif /* __GCC_ASM_FLAG_OUTPUTS__ */
-
 #endif /* __ARCH_S390_ATOMIC_OPS__  */