summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sh-sci.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2022-08-23 17:18:37 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-30 14:23:05 +0200
commita54dc4b38186e63c30db68df42487464663ae5d0 (patch)
treec7651525d58e047678716653a88d067b9144eb67 /drivers/tty/serial/sh-sci.c
parenta8c11c1520347be74b02312d10ef686b01b525f1 (diff)
downloadlinux-stable-a54dc4b38186e63c30db68df42487464663ae5d0.tar.gz
linux-stable-a54dc4b38186e63c30db68df42487464663ae5d0.tar.bz2
linux-stable-a54dc4b38186e63c30db68df42487464663ae5d0.zip
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.c4
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);