tty: core: Add tty_debug() for printk(KERN_DEBUG) messages

Introduce tty_debug() macro to output uniform debug information for
tty core debug messages (function name and tty name).

Note: printk(KERN_DEBUG) is retained here over pr_debug() since
messages can be enabled in non-DEBUG builds.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Peter Hurley
2015-07-12 22:49:08 -04:00
committed by Greg Kroah-Hartman
parent 3a6b02dc1f
commit e2dfa3d387
2 changed files with 23 additions and 24 deletions

View File

@@ -709,4 +709,10 @@ static inline void proc_tty_register_driver(struct tty_driver *d) {}
static inline void proc_tty_unregister_driver(struct tty_driver *d) {}
#endif
#define tty_debug(tty, f, args...) \
do { \
printk(KERN_DEBUG "%s: %s: " f, __func__, \
tty_name(tty), ##args); \
} while (0)
#endif