Re: [PATCH 5/7] iio: light: opt3001: localize for loop iterator

From: Andy Shevchenko

Date: Mon May 11 2026 - 07:14:06 EST


On Mon, May 11, 2026 at 12:04:10PM +0200, Joshua Crofts via B4 Relay wrote:

> Localize loop iterator to tighten scope and fix checkpatch.pl error.

Strictly speaking you do not fixing anything here related to checkpatch.pl,
you fix the code to *address* the pointed out issue.

Yeah, I know this language style issue is present in tons of the commits...

> No functional change.

...

> - int i;
> - for (i = 0; i < ARRAY_SIZE(*opt->chip_info->scales); i++) {
> + for (int i = 0; i < ARRAY_SIZE(*opt->chip_info->scales); i++) {

Maybe make it unsigned as well?


--
With Best Regards,
Andy Shevchenko