Re: [PATCH v2] iio: adc: ti-ads1018: fix type overflow for data rate

From: Jonathan Cameron

Date: Sat Mar 07 2026 - 07:15:48 EST


On Fri, 6 Mar 2026 14:08:15 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:

> On Thu, Mar 05, 2026 at 08:43:02PM +0800, Chunyang Chen wrote:
> > The variable 'drate' is currently defined as u8. However, the data rate
> > values in ads1018 can reach up to 3300 Hz, which exceeds the maximum
> > value of 255 that a u8 can hold.
> >
> > Change the type of 'drate' to u32 to match the data_rate_mode_to_hz
> > array definition and ensure the data rate is handled correctly.
> >
> > Fixes: bf0bba486b5b ("iio: adc: ti-ads1018: add ti-ads1018 driver")
> > Signed-off-by: Chunyang Chen <chenchunyang0908@xxxxxxxxx>
>
> New version — new email thread.
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
>

Applied to the fixes-togreg branch of iio.git

Thanks,

Jonathan