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>
This commit is contained in:
Joshua Crofts
2026-06-14 15:19:07 +02:00
committed by Jonathan Cameron
parent 9b77844951
commit 960642100c

View File

@@ -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.