Skip to content

Commit b59f103

Browse files
committed
s390/atomic: Remove __atomic_cmpxchg() variants
With users converted to the standard arch_cmpxchg() variants, remove the now unused __atomic_cmpxchg() and __atomic_cmpxchg_bool() variants. Reviewed-by: Juergen Christ <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent d5fd936 commit b59f103

File tree

1 file changed

+0
-75
lines changed

1 file changed

+0
-75
lines changed

arch/s390/include/asm/atomic_ops.h

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -169,79 +169,4 @@ __ATOMIC64_OPS(__atomic64_xor, "xgr")
169169

170170
#endif /* MARCH_HAS_Z196_FEATURES */
171171

172-
static __always_inline int __atomic_cmpxchg(int *ptr, int old, int new)
173-
{
174-
asm volatile(
175-
" cs %[old],%[new],%[ptr]"
176-
: [old] "+d" (old), [ptr] "+Q" (*ptr)
177-
: [new] "d" (new)
178-
: "cc", "memory");
179-
return old;
180-
}
181-
182-
static __always_inline long __atomic64_cmpxchg(long *ptr, long old, long new)
183-
{
184-
asm volatile(
185-
" csg %[old],%[new],%[ptr]"
186-
: [old] "+d" (old), [ptr] "+QS" (*ptr)
187-
: [new] "d" (new)
188-
: "cc", "memory");
189-
return old;
190-
}
191-
192-
/* GCC versions before 14.2.0 may die with an ICE in some configurations. */
193-
#if defined(__GCC_ASM_FLAG_OUTPUTS__) && !(IS_ENABLED(CONFIG_CC_IS_GCC) && (GCC_VERSION < 140200))
194-
195-
static __always_inline bool __atomic_cmpxchg_bool(int *ptr, int old, int new)
196-
{
197-
int cc;
198-
199-
asm volatile(
200-
" cs %[old],%[new],%[ptr]"
201-
: [old] "+d" (old), [ptr] "+Q" (*ptr), "=@cc" (cc)
202-
: [new] "d" (new)
203-
: "memory");
204-
return cc == 0;
205-
}
206-
207-
static __always_inline bool __atomic64_cmpxchg_bool(long *ptr, long old, long new)
208-
{
209-
int cc;
210-
211-
asm volatile(
212-
" csg %[old],%[new],%[ptr]"
213-
: [old] "+d" (old), [ptr] "+QS" (*ptr), "=@cc" (cc)
214-
: [new] "d" (new)
215-
: "memory");
216-
return cc == 0;
217-
}
218-
219-
#else /* __GCC_ASM_FLAG_OUTPUTS__ */
220-
221-
static __always_inline bool __atomic_cmpxchg_bool(int *ptr, int old, int new)
222-
{
223-
int old_expected = old;
224-
225-
asm volatile(
226-
" cs %[old],%[new],%[ptr]"
227-
: [old] "+d" (old), [ptr] "+Q" (*ptr)
228-
: [new] "d" (new)
229-
: "cc", "memory");
230-
return old == old_expected;
231-
}
232-
233-
static __always_inline bool __atomic64_cmpxchg_bool(long *ptr, long old, long new)
234-
{
235-
long old_expected = old;
236-
237-
asm volatile(
238-
" csg %[old],%[new],%[ptr]"
239-
: [old] "+d" (old), [ptr] "+QS" (*ptr)
240-
: [new] "d" (new)
241-
: "cc", "memory");
242-
return old == old_expected;
243-
}
244-
245-
#endif /* __GCC_ASM_FLAG_OUTPUTS__ */
246-
247172
#endif /* __ARCH_S390_ATOMIC_OPS__ */

0 commit comments

Comments
 (0)