On Sun, Jan 25, 2015 at 11:22 PM, Hartmut Knaack <knaack.h@xxxxxx> wrote: > > Octavian Purdila schrieb am 21.12.2014 um 01:42: > > From: Josselin Costanzi <josselin.costanzi@xxxxxxxxxxxxxxxxx> > > > > Currently the IIO buffer blocking read only wait until at least one > > data element is available. > > This patch makes the reader sleep until enough data is collected before > > returning to userspace. This should limit the read() calls count when > > trying to get data in batches. > > > > Hi, > I have a question and a minor recommendation, please see inline. > Thanks for looking at this. Any feedback on the hardware buffer stuff? We are still trying to find the right ABIs. I did not get feedback after my last reply, did it got lost? <snip> > > struct iio_dev *indio_dev = filp->private_data; > > struct iio_buffer *rb = indio_dev->buffer; > > + size_t datum_size = rb->bytes_per_datum; > > + size_t to_read = min_t(size_t, n / datum_size, rb->low_watermark); > Are you sure that rb->bytes_per_datum can not be zero, when accessed here? From > what I could see, there is a chance of it being zero, if the scan_mask is clear > and timestamps are disabled. > Good catch, I will fix that. > > + > > + /* We can't just test for watermark to decide if we wake the poll queue > > + * because read may request less samples than the watermark > I think this comment could end with a full stop. Also, first line should be > empty. > Correct. -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html