Re: [PATCH v2 1/5] clk: renesas: rzg2l: Simplify rzg2l_cpg_assert() and rzg2l_cpg_deassert()

Geert Uytterhoeven
2025-09-03T11:54:37Z

Hi Tommaso,

On Wed, 3 Sept 2025 at 10:28, Tommaso Merciai
<tommaso.merciai.xr@bp.renesas.com> wrote:
> Combine common code from rzg2l_cpg_assert() and rzg2l_cpg_deassert() into a
> new __rzg2l_cpg_assert() helper to avoid code duplication. This reduces
> maintenance effort and improves code clarity.
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v1->v2:
> - Collected GUytterhoeven tag
> - Simplify polling condition in __rzg2l_cpg_assert()

Thanks, will queue in renesas-clk for v6.18...

> --- a/drivers/clk/renesas/rzg2l-cpg.c
> +++ b/drivers/clk/renesas/rzg2l-cpg.c
> @@ -1664,37 +1668,20 @@ static int rzg2l_cpg_assert(struct reset_controller_dev *rcdev,
> }
>
> return readl_poll_timeout_atomic(priv->base + reg, value,
> - value & mask, 10, 200);
> + assert == !!(value & mask),
> + 10, 200);

... with these lines folded into a single line.

> +}
> +

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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