Re: [PATCH] clk: renesas: rzg2l: Rename iterator in for_each_mod_clock() to avoid shadowing

From: Geert Uytterhoeven

Date: Fri May 22 2026 - 09:01:16 EST


On Wed, 20 May 2026 at 11:29, Prabhakar <prabhakar.csengg@xxxxxxxxx> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
>
> Rename the internal loop iterator variable in the for_each_mod_clock()
> macro from 'i' to '__i'.
>
> The current naming conflicts with local loop variables named 'i' inside
> code blocks that utilize the macro, triggering compiler warnings due to
> variable shadowing:
>
> drivers/clk/renesas/rzg2l-cpg.c:1494:36: warning: declaration of `i` shadows a previous local [-Wshadow]
> 1494 | for (unsigned int i = 0; i < clk->num_shared_mstop_clks; i++)
>
> Using a unique identifier for the macro-internal iterator resolves the
> shadowing warnings globally across all macro expansions.
>
> Fixes: 3fd4a8bb4b63 ("clk: renesas: rzg2l: Add macro to loop through module clocks")
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
i.e. will queue in renesas-clk for v7.2.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds