diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2018-06-12 13:03:58 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-18 15:08:56 +0200 |
commit | bc19c13f4a875e5e41e05017a1326b19f01922db (patch) | |
tree | 5bfe19901618a9c29fc04e8639504f2d3a90cc28 | |
parent | mpmc_ptr_ring: add selftest (diff) | |
download | wireguard-monolithic-historical-bc19c13f4a875e5e41e05017a1326b19f01922db.tar.xz wireguard-monolithic-historical-bc19c13f4a875e5e41e05017a1326b19f01922db.zip |
mpmc_ptr_ring: Fix some style details
-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(); |