mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
clk: renesas: rzg2l: Rename iterator in for_each_mod_clock() to avoid shadowing
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: 3fd4a8bb4b ("clk: renesas: rzg2l: Add macro to loop through module clocks")
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260520092947.70596-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
This commit is contained in:
parent
8bcf12d53b
commit
1f10c45096
|
|
@ -1402,10 +1402,10 @@ struct mod_clock {
|
|||
#define to_mod_clock(_hw) container_of(_hw, struct mod_clock, hw)
|
||||
|
||||
#define for_each_mod_clock(mod_clock, hw, priv) \
|
||||
for (unsigned int i = 0; (priv) && i < (priv)->num_mod_clks; i++) \
|
||||
if ((priv)->clks[(priv)->num_core_clks + i] == ERR_PTR(-ENOENT)) \
|
||||
for (unsigned int __i = 0; (priv) && __i < (priv)->num_mod_clks; __i++) \
|
||||
if ((priv)->clks[(priv)->num_core_clks + __i] == ERR_PTR(-ENOENT)) \
|
||||
continue; \
|
||||
else if (((hw) = __clk_get_hw((priv)->clks[(priv)->num_core_clks + i])) && \
|
||||
else if (((hw) = __clk_get_hw((priv)->clks[(priv)->num_core_clks + __i])) && \
|
||||
((mod_clock) = to_mod_clock(hw)))
|
||||
|
||||
/* Need to be called with a lock held to avoid concurrent access to mstop->usecnt. */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user