summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorMartin Kelly <mkelly@xevo.com>2018-05-01 10:56:42 -0700
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2018-05-12 10:01:41 +0100
commitcbf73ae59bee340f423479eb48aef9a0efdd8010 (patch)
tree1b0ff30e17ab41169488eeb17435d2cbf83f06a8 /drivers/iio
parent21f4bb8756b22853ae3555f73ab8a44d328ee423 (diff)
downloadlinux-cbf73ae59bee340f423479eb48aef9a0efdd8010.tar.gz
linux-cbf73ae59bee340f423479eb48aef9a0efdd8010.tar.bz2
linux-cbf73ae59bee340f423479eb48aef9a0efdd8010.zip
iio: imu: inv_mpu6050: make loop a do-while
Prior to this loop, we check if fifo_count < bytes_per_datum and bail if so. This means that when we hit the loop, we know that fifo_count >= bytes_per_datum, so the check is unneeded and we can turn the loop into a do-while for a slight performance improvement. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
index 97d965181635..1795418438e4 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
@@ -175,7 +175,7 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
if (kfifo_len(&st->timestamps) >
fifo_count / bytes_per_datum + INV_MPU6050_TIME_STAMP_TOR)
goto flush_fifo;
- while (fifo_count >= bytes_per_datum) {
+ do {
result = regmap_bulk_read(st->map, st->reg->fifo_r_w,
data, bytes_per_datum);
if (result)
@@ -194,7 +194,7 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
timestamp);
fifo_count -= bytes_per_datum;
- }
+ } while (fifo_count >= bytes_per_datum);
end_session:
mutex_unlock(&st->lock);