From 601deb6e5d56fecb8cd403c63516bd0b4a14e7a9 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 10 Dec 2024 16:15:54 -0500 Subject: [PATCH] fix c11 atomics Signed-off-by: Kent Overstreet --- include/linux/atomic.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/atomic.h b/include/linux/atomic.h index c594ff8b..f7b2619a 100644 --- a/include/linux/atomic.h +++ b/include/linux/atomic.h @@ -72,14 +72,14 @@ typedef struct { #define __ATOMIC_SUB_RETURN(v, p) __atomic_sub_fetch(p, v, __ATOMIC_RELAXED) #define __ATOMIC_SUB_RETURN_RELEASE(v, p) \ __atomic_sub_fetch(p, v, __ATOMIC_RELEASE) -#define __ATOMIC_AND(p) __atomic_and_fetch(p, v, __ATOMIC_RELAXED) -#define __ATOMIC_OR(p) __atomic_or_fetch(p, v, __ATOMIC_RELAXED) +#define __ATOMIC_AND(v, p) __atomic_and_fetch(&(p)->counter, v, __ATOMIC_RELAXED) +#define __ATOMIC_OR(v, p) __atomic_or_fetch(&(p)->counter, v, __ATOMIC_RELAXED) #define xchg(p, v) __atomic_exchange_n(p, v, __ATOMIC_SEQ_CST) #define xchg_acquire(p, v) __atomic_exchange_n(p, v, __ATOMIC_ACQUIRE) #define try_cmpxchg(p, old, new) \ - __atomic_compare_exchange_n((p), __old, new, false, \ + __atomic_compare_exchange_n((p), old, new, false, \ __ATOMIC_SEQ_CST, \ __ATOMIC_SEQ_CST)