tty: n_tty: use output character directly
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Sun, 27 Aug 2023 07:41:35 +0000 (09:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Aug 2023 09:46:51 +0000 (11:46 +0200)
There is no point to use a local variable to store the character when we
can pass it directly. This assignment comes from era when we used to do
get_user(c, b). We no longer need this, so fix this.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230827074147.2287-3-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c

index 8b2bacb3e40d51ecf56bc7030ec1542bea3b2bf9..f6fa4dbdf78f7e85d65b3520dce525bb65977722 100644 (file)
@@ -2373,8 +2373,7 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
                                nr -= num;
                                if (nr == 0)
                                        break;
-                               c = *b;
-                               if (process_output(c, tty) < 0)
+                               if (process_output(*b, tty) < 0)
                                        break;
                                b++; nr--;
                        }