public inbox for [email protected]
 help / color / mirror / Atom feed
From: Bart Van Assche <[email protected]>
To: Jens Axboe <[email protected]>
Cc: [email protected], Bart Van Assche <[email protected]>
Subject: [PATCH liburing 2/7] src/include/liburing/barrier.h: Restore clang compatibility
Date: Sun, 28 Jun 2020 12:58:18 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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 <[email protected]>
---
 src/include/liburing/barrier.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/include/liburing/barrier.h b/src/include/liburing/barrier.h
index c8aa4210371c..57324348466b 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) */

  parent reply	other threads:[~2020-06-28 19:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-28 19:58 [PATCH liburing 0/7] C++ and Travis patches Bart Van Assche
2020-06-28 19:58 ` [PATCH liburing 1/7] src/Makefile: Only specify -shared at link time Bart Van Assche
2020-06-28 19:58 ` Bart Van Assche [this message]
2020-06-28 19:58 ` [PATCH liburing 3/7] Make the liburing header files again compatible with C++ Bart Van Assche
2020-06-28 19:58 ` [PATCH liburing 4/7] Add a C++ unit test Bart Van Assche
2020-06-28 19:58 ` [PATCH liburing 5/7] configure: Use $CC and $CXX as default compilers if set Bart Van Assche
2020-06-28 19:58 ` [PATCH liburing 6/7] .travis.yml: Change the language from C to C++ Bart Van Assche
2020-06-28 19:58 ` [PATCH liburing 7/7] .travis.yml: Run tests as root and ignore test results Bart Van Assche
2020-06-28 20:04 ` [PATCH liburing 0/7] C++ and Travis patches Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox