linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: core: remove redundant assignment to port
@ 2017-11-01 10:49 Colin King
  0 siblings, 0 replies; only message in thread
From: Colin King @ 2017-11-01 10:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, linux-serial
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/tty/serial/serial_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index f4e6c8662987..cdac01fe11ca 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -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);
-- 
2.14.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-01 10:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01 10:49 [PATCH] serial: core: remove redundant assignment to port Colin King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).