diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2018-06-12 13:03:58 +0200 |
---|---|---|
committer | Thomas Gschwantner <tharre3@gmail.com> | 2018-06-22 14:52:53 +0200 |
commit | 042527e9b25da85c0536b7ef7f121d39576cacc8 (patch) | |
tree | ba7c8d166a26d346f640fe3d4149c75e1c2f6fa2 /src | |
parent | mpmc_ptr_ring: add selftest (diff) | |
download | wireguard-monolithic-historical-042527e9b25da85c0536b7ef7f121d39576cacc8.tar.xz wireguard-monolithic-historical-042527e9b25da85c0536b7ef7f121d39576cacc8.zip |
mpmc_ptr_ring: Fix some style details
Diffstat (limited to 'src')
-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(); |