diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2024-11-06 11:03:11 +0100 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2024-11-12 14:01:28 +0100 |
commit | ffc5eac2cda81eec85b75338212d3098f7daef49 (patch) | |
tree | 94903d84dcb647316c98a93b083d3877e08f1e49 /arch/s390/include/asm | |
parent | c76b3bc28577b1be5ce8042d573e833f133d459a (diff) | |
download | lwn-ffc5eac2cda81eec85b75338212d3098f7daef49.tar.gz lwn-ffc5eac2cda81eec85b75338212d3098f7daef49.zip |
s390/atomic: Convert arch_atomic_xchg() to C function
Convert the arch_atomic_xchg define to a C function so that proper
type checking is provided.
Reviewed-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm')
-rw-r--r-- | arch/s390/include/asm/atomic.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h index 0c4cad7d5a5b..fcedb01c7fe0 100644 --- a/arch/s390/include/asm/atomic.h +++ b/arch/s390/include/asm/atomic.h @@ -72,7 +72,11 @@ ATOMIC_OPS(xor) #define arch_atomic_fetch_or arch_atomic_fetch_or #define arch_atomic_fetch_xor arch_atomic_fetch_xor -#define arch_atomic_xchg(v, new) (arch_xchg(&((v)->counter), new)) +static __always_inline int arch_atomic_xchg(atomic_t *v, int new) +{ + return arch_xchg(&v->counter, new); +} +#define arch_atomic_xchg arch_atomic_xchg static __always_inline int arch_atomic_cmpxchg(atomic_t *v, int old, int new) { @@ -112,7 +116,11 @@ static __always_inline void arch_atomic64_add(s64 i, atomic64_t *v) } #define arch_atomic64_add arch_atomic64_add -#define arch_atomic64_xchg(v, new) (arch_xchg(&((v)->counter), new)) +static __always_inline s64 arch_atomic64_xchg(atomic64_t *v, s64 new) +{ + return arch_xchg(&v->counter, new); +} +#define arch_atomic64_xchg arch_atomic64_xchg static __always_inline s64 arch_atomic64_cmpxchg(atomic64_t *v, s64 old, s64 new) { |