serial: sh-sci: tail is already on valid range
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 23 Aug 2022 14:18:38 +0000 (17:18 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Aug 2022 12:23:05 +0000 (14:23 +0200)
There is no need to and tail with UART_XMIT_SIZE - 1 because tail is
already on valid range.

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-2-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sh-sci.c

index cd41fe069b897d689150ae71a5c0b3c57c563497..62f773286d44bb312f67f664799494fb2405276a 100644 (file)
@@ -1407,7 +1407,7 @@ static void sci_dma_tx_work_fn(struct work_struct *work)
        spin_lock_irq(&port->lock);
        head = xmit->head;
        tail = xmit->tail;
-       buf = s->tx_dma_addr + (tail & (UART_XMIT_SIZE - 1));
+       buf = s->tx_dma_addr + tail;
        s->tx_dma_len = CIRC_CNT_TO_END(head, tail, UART_XMIT_SIZE);
        if (!s->tx_dma_len) {
                /* Transmit buffer has been flushed */