[PATCH v3 02/13] serial: rsci: Drop rsci_clear_CFC()

Biju posted 13 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCH v3 02/13] serial: rsci: Drop rsci_clear_CFC()
Posted by Biju 2 months, 3 weeks ago
From: Biju Das <biju.das.jz@bp.renesas.com>

Drop rsci_clear_CFC() by reusing rsci_clear_SCxSR() as the contents of
both functions are the same.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v2->v3:
 * No change.
v1->v2:
 * No change.
---
 drivers/tty/serial/rsci.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/tty/serial/rsci.c b/drivers/tty/serial/rsci.c
index b3c48dc1e07d..9681e8ef4bfb 100644
--- a/drivers/tty/serial/rsci.c
+++ b/drivers/tty/serial/rsci.c
@@ -199,11 +199,6 @@ static unsigned int rsci_get_mctrl(struct uart_port *port)
 	return 0;
 }
 
-static void rsci_clear_CFC(struct uart_port *port, unsigned int mask)
-{
-	rsci_serial_out(port, CFCLR, mask);
-}
-
 static void rsci_start_tx(struct uart_port *port)
 {
 	struct sci_port *sp = to_sci_port(port);
@@ -275,7 +270,7 @@ static void rsci_transmit_chars(struct uart_port *port)
 			break;
 		}
 
-		rsci_clear_CFC(port, CFCLR_TDREC);
+		rsci_clear_SCxSR(port, CFCLR_TDREC);
 		rsci_serial_out(port, TDR, c);
 
 		port->icount.tx++;
-- 
2.43.0
Re: [PATCH v3 02/13] serial: rsci: Drop rsci_clear_CFC()
Posted by Geert Uytterhoeven 2 months, 2 weeks ago
Hi Biju,

On Fri, 14 Nov 2025 at 11:52, Biju <biju.das.au@gmail.com> wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
>
> Drop rsci_clear_CFC() by reusing rsci_clear_SCxSR() as the contents of
> both functions are the same.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Thanks for your patch!

> --- a/drivers/tty/serial/rsci.c
> +++ b/drivers/tty/serial/rsci.c
> @@ -199,11 +199,6 @@ static unsigned int rsci_get_mctrl(struct uart_port *port)
>         return 0;
>  }
>
> -static void rsci_clear_CFC(struct uart_port *port, unsigned int mask)
> -{
> -       rsci_serial_out(port, CFCLR, mask);
> -}
> -

This function is indeed identical to rsci_clear_SCxSR(), so
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

However, while the sci_port_ops method is indeed called .clear_SCxSR(),
I think it makes more sense to drop rsci_clear_SCxSR() instead, as this
function touches the CFC register...

>  static void rsci_start_tx(struct uart_port *port)
>  {
>         struct sci_port *sp = to_sci_port(port);
> @@ -275,7 +270,7 @@ static void rsci_transmit_chars(struct uart_port *port)
>                         break;
>                 }
>
> -               rsci_clear_CFC(port, CFCLR_TDREC);
> +               rsci_clear_SCxSR(port, CFCLR_TDREC);

... and it is called directly.

>                 rsci_serial_out(port, TDR, c);
>
>                 port->icount.tx++;

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