On 6/21/2012 10:02 PM, Peter Meerwald wrote:
accessing first and last channel fails:
fakedata[0] is never accessed, out-of-bound access for last channel
oops. Strange I never spotted this whilst testing. Ah well, one of
those wierd ones!
Signed-off-by: Peter Meerwald <pmeerw@xxxxxxxxxx>
Acked-by: Jonathan Cameron <jic23@xxxxxxxxxx>
---
drivers/staging/iio/iio_simple_dummy_buffer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/iio/iio_simple_dummy_buffer.c b/drivers/staging/iio/iio_simple_dummy_buffer.c
index fa4939c..d911960 100644
--- a/drivers/staging/iio/iio_simple_dummy_buffer.c
+++ b/drivers/staging/iio/iio_simple_dummy_buffer.c
@@ -75,9 +75,9 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p)
for (i = 0, j = 0;
i < bitmap_weight(indio_dev->active_scan_mask,
indio_dev->masklength);
- i++) {
+ i++, j++) {
j = find_next_bit(buffer->scan_mask,
- indio_dev->masklength, j + 1);
+ indio_dev->masklength, j);
/* random access read from the 'device' */
data[i] = fakedata[j];
len += 2;
--
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