diff options
author | Jonathan Corbet <corbet@lwn.net> | 2016-11-18 16:13:41 -0700 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2016-11-18 16:13:41 -0700 |
commit | 917fef6f7ee8b2fe852692ac49771342bfef9433 (patch) | |
tree | b5932aab90d449841803b6f8679a4564ca2a6eaf /tools/virtio/ringtest/ptr_ring.c | |
parent | 0c9aa209579d41c9b8bf1fc39ce042bea2ec422d (diff) | |
parent | bc33b0ca11e3df467777a4fa7639ba488c9d4911 (diff) | |
download | linux-917fef6f7ee8b2fe852692ac49771342bfef9433.tar.gz linux-917fef6f7ee8b2fe852692ac49771342bfef9433.tar.bz2 linux-917fef6f7ee8b2fe852692ac49771342bfef9433.zip |
Merge tag 'v4.9-rc4' into sound
Bring in -rc4 patches so I can successfully merge the sound doc changes.
Diffstat (limited to 'tools/virtio/ringtest/ptr_ring.c')
-rw-r--r-- | tools/virtio/ringtest/ptr_ring.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/tools/virtio/ringtest/ptr_ring.c b/tools/virtio/ringtest/ptr_ring.c index bd2ad1d3b7a9..635b07b4fdd3 100644 --- a/tools/virtio/ringtest/ptr_ring.c +++ b/tools/virtio/ringtest/ptr_ring.c @@ -133,18 +133,9 @@ void *get_buf(unsigned *lenp, void **bufp) return datap; } -void poll_used(void) +bool used_empty() { - void *b; - - do { - if (tailcnt == headcnt || __ptr_ring_full(&array)) { - b = NULL; - barrier(); - } else { - b = "Buffer\n"; - } - } while (!b); + return (tailcnt == headcnt || __ptr_ring_full(&array)); } void disable_call() @@ -173,14 +164,9 @@ bool enable_kick() assert(0); } -void poll_avail(void) +bool avail_empty() { - void *b; - - do { - barrier(); - b = __ptr_ring_peek(&array); - } while (!b); + return !__ptr_ring_peek(&array); } bool use_buf(unsigned *lenp, void **bufp) |