Re: [PATCH v2 2/2] serial: rsci: Remove goto and refactor baud rate clock selection
From: Geert Uytterhoeven
Date: Wed Apr 08 2026 - 11:53:37 EST
On Wed, 8 Apr 2026 at 16:21, Biju <biju.das.au@xxxxxxxxx> wrote:
> From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
>
> Replace the goto done pattern in rsci_set_termios() with a positive
> conditional block. When baud rate is zero, the clock selection logic
> is now simply skipped rather than jumping to a 'done' label, eliminating
> the goto entirely.
>
> Since RSCI only uses a single clock source (SCI_FCK), the multi-clock
> tracking variables (best_clk, min_err, brr1, srr1, cks1) are redundant
> and removed. ccr0_val and ccr4_val are likewise dropped, replaced with
> hardcoded 0 at their write sites, as they were never modified from their
> initial zero values.
>
> No functional change intended.
>
> Reported-by: Pavel Machek <pavel@xxxxxxxxxxxx>
> Closes: https://lore.kernel.org/all/abPpZULsXhRmXTX9@xxxxxxxxxx/
> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> ---
> v1->v2:
> * Dropped the check (abs(err) < abs(min_err) as it is always true.
> * Dropped the check (abs(err) < abs(min_err) as it is always true.
> * Dropped variables best_clk and min_err as they are no longer needed.
> * Dropped intermediate variables brr1, cks1 and srr1; results are now
> written directly into brr, cks and srr.
> * Moved dev_dbg() inside the if (baud) block.
> * Dropped ccr0_val and ccr4_val, replaced with hardcoded 0 at their
> write sites, as they were never modified from their initial values.
> * Scoped variables err and srr locally within the if (baud) block.
> * Updated commit description.
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