summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2020-06-28 12:58:18 -0700
committerJens Axboe <axboe@kernel.dk>2020-06-28 14:03:56 -0600
commit56ff6c964c5078d76cb3c2da1a62ad671749fd42 (patch)
tree1bd4c5776de4f796064365d495b876fb66d7937e
parent2f1b09562c1a3b94a7cd9cd428e917bda7def676 (diff)
downloadliburing-56ff6c964c5078d76cb3c2da1a62ad671749fd42.tar.gz
liburing-56ff6c964c5078d76cb3c2da1a62ad671749fd42.tar.bz2
src/include/liburing/barrier.h: Restore clang compatibility
This patch fixes the following class of clang compiler errors: include/liburing.h:150:3: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid) io_uring_smp_store_release(cq->khead, *cq->khead + nr); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: b9c0bf79aa87 ("src/include/liburing/barrier.h: Use C11 atomics") Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/include/liburing/barrier.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/include/liburing/barrier.h b/src/include/liburing/barrier.h
index c8aa421..5732434 100644
--- a/src/include/liburing/barrier.h
+++ b/src/include/liburing/barrier.h
@@ -24,13 +24,17 @@ after the acquire operation executes. This is implemented using
*/
#define IO_URING_WRITE_ONCE(var, val) \
- atomic_store_explicit(&(var), (val), memory_order_relaxed)
+ atomic_store_explicit((_Atomic typeof(var) *)&(var), \
+ (val), memory_order_relaxed)
#define IO_URING_READ_ONCE(var) \
- atomic_load_explicit(&(var), memory_order_relaxed)
+ atomic_load_explicit((_Atomic typeof(var) *)&(var), \
+ memory_order_relaxed)
#define io_uring_smp_store_release(p, v) \
- atomic_store_explicit((p), (v), memory_order_release)
+ atomic_store_explicit((_Atomic typeof(*(p)) *)(p), (v), \
+ memory_order_release)
#define io_uring_smp_load_acquire(p) \
- atomic_load_explicit((p), memory_order_acquire)
+ atomic_load_explicit((_Atomic typeof(*(p)) *)(p), \
+ memory_order_acquire)
#endif /* defined(LIBURING_BARRIER_H) */