提交 9356335f 编写于 作者: C Colin Ian King 提交者: Greg Kroah-Hartman

serial: core: remove redundant assignment to port

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: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 1be22663
......@@ -1482,10 +1482,10 @@ static void uart_set_termios(struct tty_struct *tty,
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册