The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] iio: accel: bmc150: use iio_push_to_buffers_with_ts()
@ 2026-08-09 11:13 Yash Suthar
  2026-08-09 16:59 ` Andy Shevchenko
  2026-08-09 17:49 ` [PATCH v2] " Yash Suthar
  0 siblings, 2 replies; 4+ messages in thread
From: Yash Suthar @ 2026-08-09 11:13 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
	linux-kernel, Yash Suthar

Replace deprecated iio_push_to_buffers_with_timestamp() with
iio_push_to_buffers_with_ts() to allow source size runtime checks.

Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
---
Follow-up suggested in:
https://lore.kernel.org/linux-iio/261dcaa5-3e9f-4da8-adb9-dae4eb7310f2@baylibre.com/

 drivers/iio/accel/bmc150-accel-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
index dc8a6285cf3d..d904136720d5 100644
--- a/drivers/iio/accel/bmc150-accel-core.c
+++ b/drivers/iio/accel/bmc150-accel-core.c
@@ -1011,8 +1011,8 @@ static int __bmc150_accel_fifo_flush(struct iio_dev *indio_dev,
 			memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit],
 			       sizeof(data->scan.channels[0]));
 
-		iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
-						   tstamp);
+		iio_push_to_buffers_with_ts(indio_dev, &data->scan,
+					    sizeof(data->scan), tstamp);
 
 		tstamp += sample_period;
 	}
@@ -1196,8 +1196,8 @@ static irqreturn_t bmc150_accel_trigger_handler(int irq, void *p)
 	if (ret < 0)
 		goto err_read;
 
-	iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
-					   pf->timestamp);
+	iio_push_to_buffers_with_ts(indio_dev, data->buffer,
+				    sizeof(data->buffer), pf->timestamp);
 err_read:
 	iio_trigger_notify_done(indio_dev->trig);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: accel: bmc150: use iio_push_to_buffers_with_ts()
  2026-08-09 11:13 [PATCH] iio: accel: bmc150: use iio_push_to_buffers_with_ts() Yash Suthar
@ 2026-08-09 16:59 ` Andy Shevchenko
  2026-08-09 17:49 ` [PATCH v2] " Yash Suthar
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-08-09 16:59 UTC (permalink / raw)
  To: Yash Suthar
  Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	linux-iio, linux-kernel

On Sun, Aug 9, 2026 at 2:13 PM Yash Suthar <yashsuthar983@gmail.com> wrote:
>
> Replace deprecated iio_push_to_buffers_with_timestamp() with
> iio_push_to_buffers_with_ts() to allow source size runtime checks.
>
> Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
> ---
> Follow-up suggested in:
> https://lore.kernel.org/linux-iio/261dcaa5-3e9f-4da8-adb9-dae4eb7310f2@baylibre.com/

There is a tag Suggested-by. Use it.

--
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] iio: accel: bmc150: use iio_push_to_buffers_with_ts()
  2026-08-09 11:13 [PATCH] iio: accel: bmc150: use iio_push_to_buffers_with_ts() Yash Suthar
  2026-08-09 16:59 ` Andy Shevchenko
@ 2026-08-09 17:49 ` Yash Suthar
  2026-08-09 23:19   ` Jonathan Cameron
  1 sibling, 1 reply; 4+ messages in thread
From: Yash Suthar @ 2026-08-09 17:49 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, Andy Shevchenko,
	linux-iio, linux-kernel, Yash Suthar

Replace deprecated iio_push_to_buffers_with_timestamp() with
iio_push_to_buffers_with_ts() to allow source size runtime checks.

Suggested-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
---
v2:
- Add Suggested-by tag

 drivers/iio/accel/bmc150-accel-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
index dc8a6285cf3d..d904136720d5 100644
--- a/drivers/iio/accel/bmc150-accel-core.c
+++ b/drivers/iio/accel/bmc150-accel-core.c
@@ -1011,8 +1011,8 @@ static int __bmc150_accel_fifo_flush(struct iio_dev *indio_dev,
 			memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit],
 			       sizeof(data->scan.channels[0]));
 
-		iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
-						   tstamp);
+		iio_push_to_buffers_with_ts(indio_dev, &data->scan,
+					    sizeof(data->scan), tstamp);
 
 		tstamp += sample_period;
 	}
@@ -1196,8 +1196,8 @@ static irqreturn_t bmc150_accel_trigger_handler(int irq, void *p)
 	if (ret < 0)
 		goto err_read;
 
-	iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
-					   pf->timestamp);
+	iio_push_to_buffers_with_ts(indio_dev, data->buffer,
+				    sizeof(data->buffer), pf->timestamp);
 err_read:
 	iio_trigger_notify_done(indio_dev->trig);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] iio: accel: bmc150: use iio_push_to_buffers_with_ts()
  2026-08-09 17:49 ` [PATCH v2] " Yash Suthar
@ 2026-08-09 23:19   ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2026-08-09 23:19 UTC (permalink / raw)
  To: Yash Suthar
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, Andy Shevchenko,
	linux-iio, linux-kernel

On Sun,  9 Aug 2026 23:19:28 +0530
Yash Suthar <yashsuthar983@gmail.com> wrote:

> Replace deprecated iio_push_to_buffers_with_timestamp() with
> iio_push_to_buffers_with_ts() to allow source size runtime checks.
> 
> Suggested-by: David Lechner <dlechner@baylibre.com>
> Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
See the other thread.  Given there will be dependencies between
the patches, for v3, send them as a thread with an appropriate cover
letter.

Thanks,

Jonathan

> ---
> v2:
> - Add Suggested-by tag
> 
>  drivers/iio/accel/bmc150-accel-core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
> index dc8a6285cf3d..d904136720d5 100644
> --- a/drivers/iio/accel/bmc150-accel-core.c
> +++ b/drivers/iio/accel/bmc150-accel-core.c
> @@ -1011,8 +1011,8 @@ static int __bmc150_accel_fifo_flush(struct iio_dev *indio_dev,
>  			memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit],
>  			       sizeof(data->scan.channels[0]));
>  
> -		iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
> -						   tstamp);
> +		iio_push_to_buffers_with_ts(indio_dev, &data->scan,
> +					    sizeof(data->scan), tstamp);
>  
>  		tstamp += sample_period;
>  	}
> @@ -1196,8 +1196,8 @@ static irqreturn_t bmc150_accel_trigger_handler(int irq, void *p)
>  	if (ret < 0)
>  		goto err_read;
>  
> -	iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
> -					   pf->timestamp);
> +	iio_push_to_buffers_with_ts(indio_dev, data->buffer,
> +				    sizeof(data->buffer), pf->timestamp);
>  err_read:
>  	iio_trigger_notify_done(indio_dev->trig);
>  


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-09 23:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-09 11:13 [PATCH] iio: accel: bmc150: use iio_push_to_buffers_with_ts() Yash Suthar
2026-08-09 16:59 ` Andy Shevchenko
2026-08-09 17:49 ` [PATCH v2] " Yash Suthar
2026-08-09 23:19   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox