Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

TTY: pty, fix compilation warning

When CONFIG_UNIX98_PTYS is unset, we see this warning in pty:
drivers/tty/pty.c:409:13: warning: ‘pty_unix98_shutdown’ defined but not used

Fix that by moving the function to a section which depends on that
config.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reported-by: Toralf Foerster <toralf.foerster@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
f4b208eb f678c440

+6 -6
+6 -6
drivers/tty/pty.c
··· 405 405 return retval; 406 406 } 407 407 408 - /* this is called once with whichever end is closed last */ 409 - static void pty_unix98_shutdown(struct tty_struct *tty) 410 - { 411 - devpts_kill_index(tty->driver_data, tty->index); 412 - } 413 - 414 408 static void pty_cleanup(struct tty_struct *tty) 415 409 { 416 410 tty_port_put(tty->port); ··· 618 624 619 625 static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty) 620 626 { 627 + } 628 + 629 + /* this is called once with whichever end is closed last */ 630 + static void pty_unix98_shutdown(struct tty_struct *tty) 631 + { 632 + devpts_kill_index(tty->driver_data, tty->index); 621 633 } 622 634 623 635 static const struct tty_operations ptm_unix98_ops = {