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>
This commit is contained in:
Ilpo Järvinen 2022-08-23 17:18:37 +03:00 committed by Greg Kroah-Hartman
parent a8c11c1520
commit a54dc4b381

View File

@ -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);