diff options
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) | |||
133 | return datap; | 133 | return datap; |
134 | } | 134 | } |
135 | 135 | ||
136 | void poll_used(void) | 136 | bool used_empty() |
137 | { | 137 | { |
138 | void *b; | 138 | return (tailcnt == headcnt || __ptr_ring_full(&array)); |
139 | |||
140 | do { | ||
141 | if (tailcnt == headcnt || __ptr_ring_full(&array)) { | ||
142 | b = NULL; | ||
143 | barrier(); | ||
144 | } else { | ||
145 | b = "Buffer\n"; | ||
146 | } | ||
147 | } while (!b); | ||
148 | } | 139 | } |
149 | 140 | ||
150 | void disable_call() | 141 | void disable_call() |
@@ -173,14 +164,9 @@ bool enable_kick() | |||
173 | assert(0); | 164 | assert(0); |
174 | } | 165 | } |
175 | 166 | ||
176 | void poll_avail(void) | 167 | bool avail_empty() |
177 | { | 168 | { |
178 | void *b; | 169 | return !__ptr_ring_peek(&array); |
179 | |||
180 | do { | ||
181 | barrier(); | ||
182 | b = __ptr_ring_peek(&array); | ||
183 | } while (!b); | ||
184 | } | 170 | } |
185 | 171 | ||
186 | bool use_buf(unsigned *lenp, void **bufp) | 172 | bool use_buf(unsigned *lenp, void **bufp) |