提交 a50f724a 编写于 作者: J Jiri Slaby 提交者: Greg Kroah-Hartman

TTY: pty, remove superfluous ptm test

The code looks like:
if (tty->driver->subtype == PTY_TYPE_MASTER) {
  ...
  if (tty->driver == ptm_driver)

But the second if is superfluous because only the ptm_driver is of
PTY_TYPE_MASTER subtype.

Also we can remove the #if now because devpts_pty_kill is defined as
an empty function for non-CONFIG_UNIX98_PTYS configs.
Signed-off-by: NJiri Slaby <jslaby@suse.cz>
Acked-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 81f5835e
......@@ -54,10 +54,7 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
wake_up_interruptible(&tty->link->write_wait);
if (tty->driver->subtype == PTY_TYPE_MASTER) {
set_bit(TTY_OTHER_CLOSED, &tty->flags);
#ifdef CONFIG_UNIX98_PTYS
if (tty->driver == ptm_driver)
devpts_pty_kill(tty->link);
#endif
devpts_pty_kill(tty->link);
tty_unlock();
tty_vhangup(tty->link);
tty_lock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册