Re: [PATCH v2 01/13] iio: light: al3010: Use unsigned int for the indexing

From: Jonathan Cameron
Date: Sun Mar 30 2025 - 13:26:35 EST


On Wed, 19 Mar 2025 21:59:40 +0100
David Heidelberg via B4 Relay <devnull+david.ixit.cz@xxxxxxxxxx> wrote:

> From: David Heidelberg <david@xxxxxxx>
>
> The integer is used as array index which cannot be negative.
>
> Signed-off-by: David Heidelberg <david@xxxxxxx>
I do find it hard to care about these, but you are making
other changes so fair enough I guess.

Applied patches 1-2

> ---
> drivers/iio/light/al3010.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/light/al3010.c b/drivers/iio/light/al3010.c
> index 7cbb8b203300907a88f4a0ab87da89cabdd087f3..4c2fd88ab32cd73f4735b0fa3014af084037c94d 100644
> --- a/drivers/iio/light/al3010.c
> +++ b/drivers/iio/light/al3010.c
> @@ -145,7 +145,7 @@ static int al3010_write_raw(struct iio_dev *indio_dev,
> int val2, long mask)
> {
> struct al3010_data *data = iio_priv(indio_dev);
> - int i;
> + unsigned int i;
>
> switch (mask) {
> case IIO_CHAN_INFO_SCALE:
>