serial: imx: simplify check that prevents starting PIO when DMA is in use
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 2 Mar 2018 10:07:22 +0000 (11:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Mar 2018 18:21:01 +0000 (10:21 -0800)
The original code looks as follows:

if (sport->dma_is_enabled) {
... make sure TX DMA is running, i.e. .dma_is_txing = 1
}

if (sport->dma_is_txing)
return;

As .dma_is_txing can only be true if .dma_is_enabled is, the return can
go at the end of the first if body without an additional check.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c

index b87e043343427df72fcd1f8d32e6945079af9354..7356a848751e8f2bd81d0012e2a502cab7939b8c 100644 (file)
@@ -504,10 +504,9 @@ static inline void imx_transmit_buffer(struct imx_port *sport)
                        imx_uart_writel(sport, temp, UCR1);
                        imx_dma_tx(sport);
                }
-       }
 
-       if (sport->dma_is_txing)
                return;
+       }
 
        while (!uart_circ_empty(xmit) &&
               !(imx_uart_readl(sport, uts_reg(sport)) & UTS_TXFULL)) {