diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2018-07-01 05:28:38 +0200 |
---|---|---|
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2018-07-01 05:35:18 +0200 |
commit | 4214d09a611339f46cc5a8ba9c94ab4197842d0c (patch) | |
tree | de7dd840350ebc5ecc90769e212f06d64032650f | |
parent | mpmc_ptr_ring: add selftest (diff) | |
download | wireguard-monolithic-historical-4214d09a611339f46cc5a8ba9c94ab4197842d0c.tar.xz wireguard-monolithic-historical-4214d09a611339f46cc5a8ba9c94ab4197842d0c.zip |
mpmc_ptr_ring: fix some style details
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
-rw-r--r-- | src/mpmc_ptr_ring.h | 2 | ||||
-rw-r--r-- | src/selftest/mpmc_ring.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/mpmc_ptr_ring.h b/src/mpmc_ptr_ring.h index 09d56df..cbcfca4 100644 --- a/src/mpmc_ptr_ring.h +++ b/src/mpmc_ptr_ring.h @@ -95,7 +95,7 @@ static inline int mpmc_ptr_ring_produce(struct mpmc_ptr_ring *r, void *ptr) WRITE_ONCE(r->queue[p & mask], ptr); /* Wait until it's our term to update the producer tail pointer */ - while(atomic_read(&r->producer_tail) != p) + while (atomic_read(&r->producer_tail) != p) cpu_relax(); /* diff --git a/src/selftest/mpmc_ring.h b/src/selftest/mpmc_ring.h index 9503b36..97b6c1e 100644 --- a/src/selftest/mpmc_ring.h +++ b/src/selftest/mpmc_ring.h @@ -52,6 +52,7 @@ static void consumer_function(struct work_struct *work) for (i = 0; i < PER_CONSUMER; ++i) { uintptr_t value; + while (!(value = (uintptr_t) mpmc_ptr_ring_consume(ring))) schedule(); |