tty: Replace inline #ifdef TTY_DEBUG_WAIT_UNTIL_SENT
authorPeter Hurley <peter@hurleysoftware.com>
Mon, 13 Jul 2015 02:49:11 +0000 (22:49 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jul 2015 01:37:31 +0000 (18:37 -0700)
Add tty_debug_wait_until_sent() macro which uses tty_debug() to print
the debug message; remove inlined #ifdef.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_ioctl.c

index 5232fb60b0b16b9a235ee6cc090104380899b173..9c5aebfe7053cbcae1fd65a95f3312509525e8e6 100644 (file)
 
 #undef TTY_DEBUG_WAIT_UNTIL_SENT
 
+#ifdef TTY_DEBUG_WAIT_UNTIL_SENT
+# define tty_debug_wait_until_sent(tty, f, args...)    tty_debug(tty, f, ##args)
+#else
+# define tty_debug_wait_until_sent(tty, f, args...)    do {} while (0)
+#endif
+
 #undef DEBUG
 
 /*
@@ -210,9 +216,8 @@ int tty_unthrottle_safe(struct tty_struct *tty)
 
 void tty_wait_until_sent(struct tty_struct *tty, long timeout)
 {
-#ifdef TTY_DEBUG_WAIT_UNTIL_SENT
-       printk(KERN_DEBUG "%s wait until sent...\n", tty_name(tty));
-#endif
+       tty_debug_wait_until_sent(tty, "\n");
+
        if (!timeout)
                timeout = MAX_SCHEDULE_TIMEOUT;