Skip to content

Commit b74fcca

Browse files
mranostayjic23
authored andcommitted
iio: health: max30100: correct FIFO check condition
Correct issue that the last entry in FIFO was being read twice due to an incorrect decrement of entry count variable before condition check. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent f707219 commit b74fcca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iio/health/max30100.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,13 @@ static irqreturn_t max30100_interrupt_handler(int irq, void *private)
238238

239239
mutex_lock(&data->lock);
240240

241-
while (cnt-- || (cnt = max30100_fifo_count(data) > 0)) {
241+
while (cnt || (cnt = max30100_fifo_count(data) > 0)) {
242242
ret = max30100_read_measurement(data);
243243
if (ret)
244244
break;
245245

246246
iio_push_to_buffers(data->indio_dev, data->buffer);
247+
cnt--;
247248
}
248249

249250
mutex_unlock(&data->lock);

0 commit comments

Comments
 (0)