[PATCH v3 4/7] iio: light: opt3001: localize for loop iterator

From: Joshua Crofts via B4 Relay

Date: Thu May 21 2026 - 06:21:55 EST


From: Joshua Crofts <joshua.crofts1@xxxxxxxxx>

Localize loop iterator to tighten scope and improve code style
per checkpatch.pl report.

No functional change.

Signed-off-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
---
drivers/iio/light/opt3001.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c
index 09843c31516b4dcfb37e6f5e32c30aa75a03d4cf..22a73c1afa74988dabf9db10c3b55bd07529fb20 100644
--- a/drivers/iio/light/opt3001.c
+++ b/drivers/iio/light/opt3001.c
@@ -226,8 +226,7 @@ static const struct opt3001_scale opt3002_scales[] = {
static int opt3001_find_scale(const struct opt3001 *opt, int val, int val2,
u8 *exponent)
{
- int i;
- for (i = 0; i < ARRAY_SIZE(*opt->chip_info->scales); i++) {
+ for (unsigned int i = 0; i < ARRAY_SIZE(*opt->chip_info->scales); i++) {
const struct opt3001_scale *scale = &(*opt->chip_info->scales)[i];
/*
* Compare the integer and micro parts to determine value scale.

--
2.47.3