diff options
| author | Lukas Wunner <[email protected]> | 2017-11-25 00:40:49 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2017-11-28 15:32:33 +0100 |
| commit | e73be92d82e6a842eda6adac339963a3560ca0e4 (patch) | |
| tree | 3318876c5bb5da40d4b60ad508bceda84b9a48f7 | |
| parent | f859722a8f3f145b79c4371303f3d3ea7da5c4e0 (diff) | |
serial: pl011: Drop duplicate loop counter
pl011_fifo_to_tty() has two counters (max_count and fifotaken) for the
same loop. One counter should suffice. This saves one subtraction per
character read from the RX FIFO.
Cc: Mathias Duckeck <[email protected]>
Cc: Phil Elwell <[email protected]>
Cc: Stefan Wahren <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Russell King <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
| -rw-r--r-- | drivers/tty/serial/amba-pl011.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 04af8de8617e..7c8f9804f585 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -314,10 +314,9 @@ static void pl011_write(unsigned int val, const struct uart_amba_port *uap, static int pl011_fifo_to_tty(struct uart_amba_port *uap) { u16 status; - unsigned int ch, flag, max_count = 256; - int fifotaken = 0; + unsigned int ch, flag, fifotaken; - while (max_count--) { + for (fifotaken = 0; fifotaken != 256; fifotaken++) { status = pl011_read(uap, REG_FR); if (status & UART01x_FR_RXFE) break; @@ -326,7 +325,6 @@ static int pl011_fifo_to_tty(struct uart_amba_port *uap) ch = pl011_read(uap, REG_DR) | UART_DUMMY_DR_RX; flag = TTY_NORMAL; uap->port.icount.rx++; - fifotaken++; if (unlikely(ch & UART_DR_ERROR)) { if (ch & UART011_DR_BE) { |