diff options
| author | Joshua Crofts <joshua.crofts1@gmail.com> | 2026-06-14 15:19:07 +0200 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2026-06-30 00:15:54 +0100 |
| commit | 960642100cabecd6f7138b8a8d62dd218ac9f2ca (patch) | |
| tree | 8768824ebd807fce4f07e961b89a3878f8b54cb0 | |
| parent | 9b7784495181f7dba1edbdb66bef9f681c7956c5 (diff) | |
iio: light: opt3001: localize for loop iterator
Localize loop iterator to tighten scope and improve code style
per checkpatch.pl report.
No functional change.
Reviewed-by: Maxwell Doose <m32285159@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| -rw-r--r-- | drivers/iio/light/opt3001.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c index 6634054506da..c301549ddaa7 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. |
