]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
serial: core: remove redundant assignment to port
authorColin Ian King <colin.king@canonical.com>
Wed, 1 Nov 2017 10:49:23 +0000 (10:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Nov 2017 11:08:53 +0000 (12:08 +0100)
The final assignment to port is never read, hence it is redundant
and can be removed. Also move the declaration of port to a more
local scope.  Cleans up clang warning:

drivers/tty/serial/serial_core.c:1498:2: warning: Value stored
to 'port' is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c

index f4e6c866298794be94596659562a33fd952ac14c..cdac01fe11cacf1ff65f914aad5404699b6c1f1e 100644 (file)
@@ -1482,10 +1482,10 @@ out:
 static void uart_close(struct tty_struct *tty, struct file *filp)
 {
        struct uart_state *state = tty->driver_data;
-       struct tty_port *port;
 
        if (!state) {
                struct uart_driver *drv = tty->driver->driver_state;
+               struct tty_port *port;
 
                state = drv->state + tty->index;
                port = &state->port;
@@ -1495,7 +1495,6 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
                return;
        }
 
-       port = &state->port;
        pr_debug("uart_close(%d) called\n", tty->index);
 
        tty_port_close(tty->port, tty, filp);