[19/44] serial: liteuart: Use uart_xmit_advance()

Message ID 20221019091151.6692-20-ilpo.jarvinen@linux.intel.com
State New
Headers
Series serial: Convert drivers to use uart_xmit_advance() |

Commit Message

Ilpo Järvinen Oct. 19, 2022, 9:11 a.m. UTC
  Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/liteuart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Gabriel L. Somlo Oct. 19, 2022, 2:59 p.m. UTC | #1
On Wed, Oct 19, 2022 at 12:11:26PM +0300, Ilpo Järvinen wrote:
> Take advantage of the new uart_xmit_advance() helper.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
>  drivers/tty/serial/liteuart.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c
> index 4c0604325ee9..062812fe1b09 100644
> --- a/drivers/tty/serial/liteuart.c
> +++ b/drivers/tty/serial/liteuart.c
> @@ -136,8 +136,7 @@ static void liteuart_start_tx(struct uart_port *port)
>  	} else if (!uart_circ_empty(xmit)) {
>  		while (xmit->head != xmit->tail) {
>  			ch = xmit->buf[xmit->tail];
> -			xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
> -			port->icount.tx++;
> +			uart_xmit_advance(port, 1);

Acked-by: Gabriel Somlo <gsomlo@gmail.com>

Thanks,
--Gabriel

>  			liteuart_putchar(port, ch);
>  		}
>  	}
> -- 
> 2.30.2
>
  

Patch

diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c
index 4c0604325ee9..062812fe1b09 100644
--- a/drivers/tty/serial/liteuart.c
+++ b/drivers/tty/serial/liteuart.c
@@ -136,8 +136,7 @@  static void liteuart_start_tx(struct uart_port *port)
 	} else if (!uart_circ_empty(xmit)) {
 		while (xmit->head != xmit->tail) {
 			ch = xmit->buf[xmit->tail];
-			xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-			port->icount.tx++;
+			uart_xmit_advance(port, 1);
 			liteuart_putchar(port, ch);
 		}
 	}