提交 909bc774 编写于 作者: H Herton Ronaldo Krzesinski 提交者: Greg Kroah-Hartman

vt: remove uneeded retval check before tty->ops->open inside tty_open

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: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 f0e615c3
...@@ -1902,12 +1902,10 @@ static int tty_open(struct inode *inode, struct file *filp) ...@@ -1902,12 +1902,10 @@ static int tty_open(struct inode *inode, struct file *filp)
#ifdef TTY_DEBUG_HANGUP #ifdef TTY_DEBUG_HANGUP
printk(KERN_DEBUG "opening %s...", tty->name); printk(KERN_DEBUG "opening %s...", tty->name);
#endif #endif
if (!retval) { if (tty->ops->open)
if (tty->ops->open) retval = tty->ops->open(tty, filp);
retval = tty->ops->open(tty, filp); else
else retval = -ENODEV;
retval = -ENODEV;
}
filp->f_flags = saved_flags; filp->f_flags = saved_flags;
if (!retval && test_bit(TTY_EXCLUSIVE, &tty->flags) && if (!retval && test_bit(TTY_EXCLUSIVE, &tty->flags) &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册