On Sat, Jun 21, 2025 at 02:26:12PM -0400, Geoff Steckel wrote: > Recent C standards allow (a) > for (int i = 0; i < 10; i++) > which limits the scope of i to the loop > instead of (b) > int i; > for (i = 0; .... > which leaves i in scope > > Is it permissible to use (a) in kernel code when the value of i is > not used outside the loop?
Note that there are already a few instances of this construct in the kernel code. So if it's not desired, we should maybe eliminate those.