serial: core: Remove extra locking in uart_write()
authorPeter Hurley <peter@hurleysoftware.com>
Thu, 16 Oct 2014 20:54:26 +0000 (16:54 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Nov 2014 02:53:55 +0000 (18:53 -0800)
uart_start() only claims the port->lock to call __uart_start(),
which does the actual processing. Eliminate the extra acquire/release
in uart_write(); call __uart_start() directly with port->lock already
held.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c

index e0082b73c198c55fac20246e2e564f37e9930d07..0282eaaff517adba1fee25b6353d5b168c28ac23 100644 (file)
@@ -537,9 +537,10 @@ static int uart_write(struct tty_struct *tty,
                count -= c;
                ret += c;
        }
+
+       __uart_start(tty);
        spin_unlock_irqrestore(&port->lock, flags);
 
-       uart_start(tty);
        return ret;
 }