Re: [PATCH] iio: chemical: scd30: Prevent potential divide-by-zero error

From: Maxwell Doose

Date: Sat May 09 2026 - 17:54:01 EST


On Sat, May 9, 2026 at 4:47 PM David Lechner <dlechner@xxxxxxxxxxxx> wrote:
> On 5/9/26 4:36 PM, Maxwell Doose wrote:
> > Yes, we're reading over either SPI or I2C, the sensor supports both.
> > Hardware failure is going to be the most likely cause of this path
> > being taken, but I could also see some sort of noise on the bus being
> > the cause. Perhaps we change it to:
> >
> > /* Likely taken if hardware is failing or noise on bus */
> >
> > best regards,
> > max
>
> Sounds OK.
>
> A more verbose alternative:
>
> /*
> * Value of 0 is unexpected, but could happen, e.g. due to
> * hardware failure.
> */

Also works for me, I'm impartial to either. Perhaps we can see if
Jonathan is willing to change it during merge or if I'll have to go
back and change it in a v2.

best regards,
max