Skip to contentSkip to conversation

iio: adc : ad7944 : replace deprecated iio_push_to_buffers_with_timestamp()

PATCH In review Atharv Dubey 1 participant 1 message Mar 16

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 11/11 iio: adc : ad7944 : replace deprecated iio_push_to_buffers_with_timestamp()

iio_push_to_buffers_with_timestamp() is deprecated. Replace it with iio_push_to_buffers_with_ts(), which takes the buffer size as an argument and helps avoid potential buffer overflows.

---
 drivers/iio/adc/ad7944.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/iio/adc/ad7944.c +6 -4
index 7722cf9e8214..479ab882edc9 100644
@@ -532,11 +532,13 @@ static irqreturn_t ad7944_trigger_handler(int irq, void *p)
 		goto out;
 
 	if (adc->spi_mode == AD7944_SPI_MODE_CHAIN)
-		iio_push_to_buffers_with_timestamp(indio_dev, adc->chain_mode_buf,
-						   pf->timestamp);
+		iio_push_to_buffers_with_ts(indio_dev, adc->chain_mode_buf,
+					       sizeof(adc->chain_mode_buf),
+							    pf->timestamp);
 	else
-		iio_push_to_buffers_with_timestamp(indio_dev, &adc->sample.raw,
-						   pf->timestamp);
+		iio_push_to_buffers_with_ts(indio_dev, &adc->sample.raw,
+						sizeof(adc->sample.raw),
+							 pf->timestamp);
 
 out:
 	iio_trigger_notify_done(indio_dev->trig);
Signature · 1 line
2.43.0