Re: [PATCH 1/2] clk: renesas: cpg-mssr: simplify pointer math in cpg_rzt2h_mstp_read()

From: Geert Uytterhoeven

Date: Wed Jan 07 2026 - 09:09:01 EST


Hi Cosmin,

On Thu, 27 Nov 2025 at 15:59, Cosmin Tanislav
<cosmin-gabriel.tanislav.xa@xxxxxxxxxxx> wrote:
> Private state is available in all places where cpg_rzt2h_mstp_read() is
> called, remove the extra pointer math used to find it from clk_hw.
>
> While at it, put these statements on a single line as they do not exceed
> the 80 columns limit.
>
> Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@xxxxxxxxxxx>

Thanks for your patch!

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

> --- a/drivers/clk/renesas/renesas-cpg-mssr.c
> +++ b/drivers/clk/renesas/renesas-cpg-mssr.c

> @@ -286,17 +282,14 @@ static int cpg_mstp_clock_endisable(struct clk_hw *hw, bool enable)
> barrier_data(priv->pub.base0 + priv->control_regs[reg]);
>
> } else if (priv->reg_layout == CLK_REG_LAYOUT_RZ_T2H) {
> - value = cpg_rzt2h_mstp_read(hw,
> - priv->control_regs[reg]);
> + value = cpg_rzt2h_mstp_read(priv, priv->control_regs[reg]);

All callers of cpg_rzt2h_mstp_{read,write}() pass priv->control_regs[reg],
so a future consolidation could change that parameter to reg.

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