diff mbox series

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

Message ID 20250319-al3010-iio-regmap-v2-1-1310729d0543@ixit.cz (mailing list archive)
State Accepted
Headers show
Series iio: light: Modernize al3010 and al3320a codebase | expand

Commit Message

David Heidelberg March 19, 2025, 8:59 p.m. UTC
From: David Heidelberg <david@ixit.cz>

The integer is used as array index which cannot be negative.

Signed-off-by: David Heidelberg <david@ixit.cz>
---
 drivers/iio/light/al3010.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Cameron March 30, 2025, 5:26 p.m. UTC | #1
On Wed, 19 Mar 2025 21:59:40 +0100
David Heidelberg via B4 Relay <devnull+david.ixit.cz@kernel.org> wrote:

> From: David Heidelberg <david@ixit.cz>
> 
> The integer is used as array index which cannot be negative.
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>
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:
>
diff mbox series

Patch

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: