From: Joshua Crofts Date: Mon, 25 May 2026 10:20:18 +0200 Subject: [PATCH v4 4/8] iio: light: opt3001: localize for loop iterator MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260525-opt3001-cleanup-v4-4-65b36a174f78@gmail.com> References: <20260525-opt3001-cleanup-v4-0-65b36a174f78@gmail.com> In-Reply-To: <20260525-opt3001-cleanup-v4-0-65b36a174f78@gmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Joshua Crofts X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779697227; l=1002; i=joshua.crofts1@gmail.com; s=20260422; h=from:subject:message-id; bh=tpQWvMzLOXdTHcX1LxcT0aRdkJtE7TOkAhwdw+eYL50=; b=rEJWopHXR047UG34D8sbIWbnoJGBfBE/ybb2YquNqHemTOhR8qwO94kxt9HrGdlXb0WGVFETB ijMwIe4G+LKC8GjxhA35IhGnJclOY0x8lh5AFn6jH063r1a7km5vNz3 X-Developer-Key: i=joshua.crofts1@gmail.com; a=ed25519; pk=Xd+UVoRPiiI0K3LHQ2XIcXmO0jvVuFTv9eTx3lgBphI= X-Endpoint-Received: by B4 Relay for joshua.crofts1@gmail.com/20260422 with auth_id=746 List-Id: B4 Relay Submissions Localize loop iterator to tighten scope and improve code style per checkpatch.pl report. No functional change. Signed-off-by: Joshua Crofts --- 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 532929e8fa8b4172eadc696e927315017a07dac1..777a54753b0c84dbee40980101019450fcd06af1 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