Skip to content

Commit

Permalink
vt: remove uneeded retval check before tty->ops->open inside tty_open
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herton Ronaldo Krzesinski authored and Greg Kroah-Hartman committed Apr 19, 2011
1 parent f0e615c commit 909bc77
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1902,12 +1902,10 @@ static int tty_open(struct inode *inode, struct file *filp)
#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) &&
Expand Down

0 comments on commit 909bc77

Please sign in to comment.