]> git.karo-electronics.de Git - linux-beck.git/commitdiff
n_tty: Remove unnecessary local variable
authorPeter Hurley <peter@hurleysoftware.com>
Tue, 17 Sep 2013 16:53:35 +0000 (12:53 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Sep 2013 01:05:32 +0000 (18:05 -0700)
Flatten conditional evaluation in n_tty_set_termios; remove
canon_change.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c

index 41c0c80094a501999c15ab4f378197ee0a79ab45..5372bf0e74ab17a1c29c907e08289c16fe5ca3e2 100644 (file)
@@ -1752,11 +1752,8 @@ int is_ignored(int sig)
 static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
 {
        struct n_tty_data *ldata = tty->disc_data;
-       int canon_change = 1;
 
-       if (old)
-               canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON;
-       if (canon_change) {
+       if (!old || (old->c_lflag ^ tty->termios.c_lflag) & ICANON) {
                bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE);
                ldata->line_start = 0;
                ldata->canon_head = ldata->read_tail;