Re: [PATCH 1/4] clk: renesas: rzg2l: Simplify rzg2l_cpg_assert() and rzg2l_cpg_deassert()
From: Tommaso Merciai
Date: Tue Sep 02 2025 - 09:17:32 EST
Hi Geert,
Thanks for your review!
On Tue, Sep 02, 2025 at 02:12:50PM +0200, Geert Uytterhoeven wrote:
> Hi Tommaso,
>
> On Wed, 20 Aug 2025 at 12:05, Tommaso Merciai
> <tommaso.merciai.xr@xxxxxxxxxxxxxx> 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.
> >
> > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@xxxxxxxxxxxxxx>
>
> Thanks for your patch!
>
> > --- 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) : !(value & mask),
>
> This can be simplified to "assert == !!(value & mask)".
> Do you like that?
Yes, thanks.
Looks good to me.
Thanks & Regards,
Tommaso
>
> > + 10, 200);
> > +}
>
> The rest LGTM, so
> 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