Re: [PATCH 2/4] clk: renesas: rzg2l-cpg: Simplify rzg3s_cpg_div_clk_register function

From: Geert Uytterhoeven
Date: Fri Jul 12 2024 - 09:59:44 EST


Hi Prabhakar,

On Fri, Jun 28, 2024 at 3:11 PM Prabhakar <prabhakar.csengg@xxxxxxxxx> wrote:
>
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
>
> Refactor the `rzg3s_cpg_div_clk_register` function to eliminate the
> unnecessary `base` parameter and streamline parameter usage. The `base`
> pointer was unused, and the `clks` pointer can be accessed directly from
> the `priv` structure.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>

Thanks for your patch!

> --- a/drivers/clk/renesas/rzg2l-cpg.c
> +++ b/drivers/clk/renesas/rzg2l-cpg.c
> @@ -339,9 +339,9 @@ static const struct clk_ops rzg3s_div_clk_ops = {
> };
>
> static struct clk * __init
> -rzg3s_cpg_div_clk_register(const struct cpg_core_clk *core, struct clk **clks,
> - void __iomem *base, struct rzg2l_cpg_priv *priv)
> +rzg3s_cpg_div_clk_register(const struct cpg_core_clk *core, struct rzg2l_cpg_priv *priv)
> {
> + struct clk **clks = priv->clks;

"clks" is used only once in this function, so I'd rather use priv->clks[...]
directly below instead of adding another local variable.

> struct div_hw_data *div_hw_data;
> struct clk_init_data init = {};
> const struct clk_div_table *clkt;

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

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