diff mbox series

tty: pty: remove redundant local variable

Message ID 20250226204707.1941274-1-vvidic@valentin-vidic.from.hr
State New
Headers show
Series tty: pty: remove redundant local variable | expand

Commit Message

Valentin Vidic Feb. 26, 2025, 8:47 p.m. UTC
The value of to is only used once, so no need to store it in a
variable.

Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
---
 drivers/tty/pty.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index df08f13052ff..c6eb711500b6 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -110,12 +110,10 @@  static void pty_unthrottle(struct tty_struct *tty)
 
 static ssize_t pty_write(struct tty_struct *tty, const u8 *buf, size_t c)
 {
-	struct tty_struct *to = tty->link;
-
 	if (tty->flow.stopped || !c)
 		return 0;
 
-	return tty_insert_flip_string_and_push_buffer(to->port, buf, c);
+	return tty_insert_flip_string_and_push_buffer(tty->link->port, buf, c);
 }
 
 /**