This is a bad one. The test means that almost no reads of the last
value ever succeed! Result is an infinite loop.
Another one for the 'oops' category.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return -EAGAIN;
memcpy(data, last_written_p_copy, ring->buf.bpd);
- if (unlikely(ring->last_written_p >= last_written_p_copy))
+ if (unlikely(ring->last_written_p != last_written_p_copy))
goto again;
iio_unmark_sw_rb_in_use(&ring->buf);