diff options
author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2022-08-23 17:18:37 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-30 15:23:05 +0300 |
commit | a54dc4b38186e63c30db68df42487464663ae5d0 (patch) | |
tree | c7651525d58e047678716653a88d067b9144eb67 /drivers/tty/serial/sh-sci.c | |
parent | a8c11c1520347be74b02312d10ef686b01b525f1 (diff) | |
download | linux-a54dc4b38186e63c30db68df42487464663ae5d0.tar.xz |
serial: sh-sci: CIRC_CNT_TO_END() is enough
Testing also CIRC_CNT() with CIRC_CNT_TO_END() is unnecessary because
to latter alone covers all necessary cases.
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220823141839.165244-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/sh-sci.c')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 9ad3663b5152..cd41fe069b89 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1408,9 +1408,7 @@ static void sci_dma_tx_work_fn(struct work_struct *work) head = xmit->head; tail = xmit->tail; buf = s->tx_dma_addr + (tail & (UART_XMIT_SIZE - 1)); - s->tx_dma_len = min_t(unsigned int, - CIRC_CNT(head, tail, UART_XMIT_SIZE), - CIRC_CNT_TO_END(head, tail, UART_XMIT_SIZE)); + s->tx_dma_len = CIRC_CNT_TO_END(head, tail, UART_XMIT_SIZE); if (!s->tx_dma_len) { /* Transmit buffer has been flushed */ spin_unlock_irq(&port->lock); |