From: Joshua Crofts Date: Tue, 12 May 2026 12:57:26 +0200 Subject: [PATCH v2 06/10] iio: light: opt3001: localize for loop iterator MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260512-opt3001-cleanup-v2-6-8018cf3a8a0a@gmail.com> References: <20260512-opt3001-cleanup-v2-0-8018cf3a8a0a@gmail.com> In-Reply-To: <20260512-opt3001-cleanup-v2-0-8018cf3a8a0a@gmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Alexander Koch , Michael Hornung 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=1778583471; l=1002; i=joshua.crofts1@gmail.com; s=20260422; h=from:subject:message-id; bh=AsyGssNVmON9RQX/C6khFPg58cqD0NGGocT4co0wy1s=; b=nthaInSsVtNIjCRF2FMDgEAjZvToY06ZDGOssNu6LjIgq1pmnstb8y9TxPk9zfDQD/tiYbmT9 f5iToYop3QICm1hcKzsoh6GqjgMbnLC40+c2t24KsmCqvpRQm1e25MI 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 ad729152bb9266a35919e3abe576e792dbc08730..8eaa2cb6b5b044afdc405f19cd2499abb7e4d7a3 100644 --- a/drivers/iio/light/opt3001.c +++ b/drivers/iio/light/opt3001.c @@ -227,8 +227,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