]> git.karo-electronics.de Git - linux-beck.git/commitdiff
vt: remove uneeded retval check before tty->ops->open inside tty_open
authorHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Thu, 31 Mar 2011 18:35:31 +0000 (15:35 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 19 Apr 2011 21:39:28 +0000 (14:39 -0700)
The current check is uneeded, since !retval will always returns true,
as retval returned from tty_add_file is checked earlier and tty_open
exits if it's not zero.

Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/tty_io.c

index d7d50b48287e8a7374e4d2e814527b4faa9dfaa9..188632e4734d2b8fa259d597db913f70cfe3ca6e 100644 (file)
@@ -1902,12 +1902,10 @@ got_driver:
 #ifdef TTY_DEBUG_HANGUP
        printk(KERN_DEBUG "opening %s...", tty->name);
 #endif
-       if (!retval) {
-               if (tty->ops->open)
-                       retval = tty->ops->open(tty, filp);
-               else
-                       retval = -ENODEV;
-       }
+       if (tty->ops->open)
+               retval = tty->ops->open(tty, filp);
+       else
+               retval = -ENODEV;
        filp->f_flags = saved_flags;
 
        if (!retval && test_bit(TTY_EXCLUSIVE, &tty->flags) &&