summaryrefslogtreecommitdiffstats
path: root/drivers/iio/industrialio-buffer.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2020-01-20 08:05:16 +0100
committerIngo Molnar <mingo@kernel.org>2020-01-20 08:05:16 +0100
commita786810cc864e31237a755b933e8872ba3e118bc (patch)
treef94bd068691d03be00b582fd2fdabe7ccff0f044 /drivers/iio/industrialio-buffer.c
parent4444f8541dad16fefd9b8807ad1451e806ef1d94 (diff)
parentdef9d2780727cec3313ed3522d0123158d87224d (diff)
downloadtalos-op-linux-a786810cc864e31237a755b933e8872ba3e118bc.tar.gz
talos-op-linux-a786810cc864e31237a755b933e8872ba3e118bc.zip
Merge tag 'v5.5-rc7' into efi/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/iio/industrialio-buffer.c')
-rw-r--r--drivers/iio/industrialio-buffer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index c193d64e5217..112225c0e486 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -566,7 +566,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev,
const unsigned long *mask, bool timestamp)
{
unsigned bytes = 0;
- int length, i;
+ int length, i, largest = 0;
/* How much space will the demuxed element take? */
for_each_set_bit(i, mask,
@@ -574,13 +574,17 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev,
length = iio_storage_bytes_for_si(indio_dev, i);
bytes = ALIGN(bytes, length);
bytes += length;
+ largest = max(largest, length);
}
if (timestamp) {
length = iio_storage_bytes_for_timestamp(indio_dev);
bytes = ALIGN(bytes, length);
bytes += length;
+ largest = max(largest, length);
}
+
+ bytes = ALIGN(bytes, largest);
return bytes;
}
OpenPOWER on IntegriCloud