[PATCH 01/11] iio: ad_sigma_delta: replace deprecated iio_push_to_buffers_with_timestamp()

Atharv Dubey posted 11 patches 3 weeks ago
Only 9 patches received!
There is a newer version of this series
[PATCH 01/11] iio: ad_sigma_delta: replace deprecated iio_push_to_buffers_with_timestamp()
Posted by Atharv Dubey 3 weeks ago
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.

Signed-off-by: Atharv Dubey <atharvd440@gmail.com>
---
 drivers/iio/adc/ad_sigma_delta.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
index 7852884703b0..73f3069da987 100644
--- a/drivers/iio/adc/ad_sigma_delta.c
+++ b/drivers/iio/adc/ad_sigma_delta.c
@@ -636,7 +636,7 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
 	 * once, there is no need for sample number tracking.
 	 */
 	if (sigma_delta->active_slots == 1) {
-		iio_push_to_buffers_with_timestamp(indio_dev, data, pf->timestamp);
+		iio_push_to_buffers_with_ts(indio_dev, data, sizeof(data), pf->timestamp);
 		goto irq_handled;
 	}
 
@@ -662,8 +662,8 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
 
 	if (sigma_delta->current_slot == sigma_delta->active_slots) {
 		sigma_delta->current_slot = 0;
-		iio_push_to_buffers_with_timestamp(indio_dev, sigma_delta->samples_buf,
-						   pf->timestamp);
+		iio_push_to_buffers_with_ts(indio_dev, sigma_delta->samples_buf,
+				sizeof(sigma_delta->sampkes_buf), pf->timestamp);
 	}
 
 irq_handled:
-- 
2.43.0
Re: [PATCH 01/11] iio: ad_sigma_delta: replace deprecated iio_push_to_buffers_with_timestamp()
Posted by Jonathan Cameron 3 weeks ago
On Mon, 16 Mar 2026 22:57:27 +0530
Atharv Dubey <atharvd440@gmail.com> wrote:

> 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.
> 
> Signed-off-by: Atharv Dubey <atharvd440@gmail.com>
Hi Atharv,

Thank for you for your patch.


> ---
>  drivers/iio/adc/ad_sigma_delta.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
> index 7852884703b0..73f3069da987 100644
> --- a/drivers/iio/adc/ad_sigma_delta.c
> +++ b/drivers/iio/adc/ad_sigma_delta.c
> @@ -636,7 +636,7 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
>  	 * once, there is no need for sample number tracking.
>  	 */
>  	if (sigma_delta->active_slots == 1) {
> -		iio_push_to_buffers_with_timestamp(indio_dev, data, pf->timestamp);
> +		iio_push_to_buffers_with_ts(indio_dev, data, sizeof(data), pf->timestamp);

What is sizeof(data) and why is that the right value to pass as the new parameter?

>  		goto irq_handled;
>  	}
>  
> @@ -662,8 +662,8 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
>  
>  	if (sigma_delta->current_slot == sigma_delta->active_slots) {
>  		sigma_delta->current_slot = 0;
> -		iio_push_to_buffers_with_timestamp(indio_dev, sigma_delta->samples_buf,
> -						   pf->timestamp);
> +		iio_push_to_buffers_with_ts(indio_dev, sigma_delta->samples_buf,
> +				sizeof(sigma_delta->sampkes_buf), pf->timestamp);
Likewise. What value does the new parameter take?

I'm not going to review any more of this version of the series given these are
both incorrect in the first patch.

Jonathan

>  	}
>  
>  irq_handled:
Re: [PATCH 01/11] iio: ad_sigma_delta: replace deprecated iio_push_to_buffers_with_timestamp()
Posted by Atharv Dubey 2 weeks, 4 days ago
Hi Jonathan,

On 3/16/26 23:49, Jonathan Cameron wrote:
> On Mon, 16 Mar 2026 22:57:27 +0530
> Atharv Dubey <atharvd440@gmail.com> wrote:
>
>> 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.
>>
>> Signed-off-by: Atharv Dubey <atharvd440@gmail.com>
> Hi Atharv,
>
> Thank for you for your patch.
>
>
>> ---
>>   drivers/iio/adc/ad_sigma_delta.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
>> index 7852884703b0..73f3069da987 100644
>> --- a/drivers/iio/adc/ad_sigma_delta.c
>> +++ b/drivers/iio/adc/ad_sigma_delta.c
>> @@ -636,7 +636,7 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
>>   	 * once, there is no need for sample number tracking.
>>   	 */
>>   	if (sigma_delta->active_slots == 1) {
>> -		iio_push_to_buffers_with_timestamp(indio_dev, data, pf->timestamp);
>> +		iio_push_to_buffers_with_ts(indio_dev, data, sizeof(data), pf->timestamp);
> What is sizeof(data) and why is that the right value to pass as the new parameter?
>
>>   		goto irq_handled;
>>   	}
>>   
>> @@ -662,8 +662,8 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
>>   
>>   	if (sigma_delta->current_slot == sigma_delta->active_slots) {
>>   		sigma_delta->current_slot = 0;
>> -		iio_push_to_buffers_with_timestamp(indio_dev, sigma_delta->samples_buf,
>> -						   pf->timestamp);
>> +		iio_push_to_buffers_with_ts(indio_dev, sigma_delta->samples_buf,
>> +				sizeof(sigma_delta->sampkes_buf), pf->timestamp);
> Likewise. What value does the new parameter take?
>
> I'm not going to review any more of this version of the series given these are
> both incorrect in the first patch.
>
> Jonathan


You are right, both the fixes are incorrect let me try more on this. 
I'll send a smaller patch series first and mark it as an RFC.

>
>>   	}
>>   
>>   irq_handled:
>   

Regards,
Atharv