Commit d435cefe authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

tty: Remove __func__ from tty_debug() macro

Now that tty_debug() macro uses pr_debug(), the function name can
be printed when using dynamic debug; printing the function name within
the format string is redundant.

Remove the __func__ parameter and print specifier from the format string.
Add context to messages for when the function name is not printed by
dynamic debug, or when dynamic debug is not enabled.
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 89222e62
...@@ -788,7 +788,7 @@ static int ptmx_open(struct inode *inode, struct file *filp) ...@@ -788,7 +788,7 @@ static int ptmx_open(struct inode *inode, struct file *filp)
if (retval) if (retval)
goto err_release; goto err_release;
tty_debug_hangup(tty, "(tty count=%d)\n", tty->count); tty_debug_hangup(tty, "opening (count=%d)\n", tty->count);
tty_unlock(tty); tty_unlock(tty);
return 0; return 0;
......
...@@ -783,7 +783,7 @@ static void do_tty_hangup(struct work_struct *work) ...@@ -783,7 +783,7 @@ static void do_tty_hangup(struct work_struct *work)
void tty_hangup(struct tty_struct *tty) void tty_hangup(struct tty_struct *tty)
{ {
tty_debug_hangup(tty, "\n"); tty_debug_hangup(tty, "hangup\n");
schedule_work(&tty->hangup_work); schedule_work(&tty->hangup_work);
} }
...@@ -800,7 +800,7 @@ EXPORT_SYMBOL(tty_hangup); ...@@ -800,7 +800,7 @@ EXPORT_SYMBOL(tty_hangup);
void tty_vhangup(struct tty_struct *tty) void tty_vhangup(struct tty_struct *tty)
{ {
tty_debug_hangup(tty, "\n"); tty_debug_hangup(tty, "vhangup\n");
__tty_hangup(tty, 0); __tty_hangup(tty, 0);
} }
...@@ -837,7 +837,7 @@ void tty_vhangup_self(void) ...@@ -837,7 +837,7 @@ void tty_vhangup_self(void)
static void tty_vhangup_session(struct tty_struct *tty) static void tty_vhangup_session(struct tty_struct *tty)
{ {
tty_debug_hangup(tty, "\n"); tty_debug_hangup(tty, "session hangup\n");
__tty_hangup(tty, 1); __tty_hangup(tty, 1);
} }
...@@ -1787,7 +1787,7 @@ int tty_release(struct inode *inode, struct file *filp) ...@@ -1787,7 +1787,7 @@ int tty_release(struct inode *inode, struct file *filp)
return 0; return 0;
} }
tty_debug_hangup(tty, "(tty count=%d)...\n", tty->count); tty_debug_hangup(tty, "releasing (count=%d)\n", tty->count);
if (tty->ops->close) if (tty->ops->close)
tty->ops->close(tty, filp); tty->ops->close(tty, filp);
...@@ -1903,7 +1903,7 @@ int tty_release(struct inode *inode, struct file *filp) ...@@ -1903,7 +1903,7 @@ int tty_release(struct inode *inode, struct file *filp)
/* Wait for pending work before tty destruction commmences */ /* Wait for pending work before tty destruction commmences */
tty_flush_works(tty); tty_flush_works(tty);
tty_debug_hangup(tty, "freeing structure...\n"); tty_debug_hangup(tty, "freeing structure\n");
/* /*
* The release_tty function takes care of the details of clearing * The release_tty function takes care of the details of clearing
* the slots and preserving the termios structure. The tty_unlock_pair * the slots and preserving the termios structure. The tty_unlock_pair
...@@ -2093,7 +2093,7 @@ static int tty_open(struct inode *inode, struct file *filp) ...@@ -2093,7 +2093,7 @@ static int tty_open(struct inode *inode, struct file *filp)
tty->driver->subtype == PTY_TYPE_MASTER) tty->driver->subtype == PTY_TYPE_MASTER)
noctty = 1; noctty = 1;
tty_debug_hangup(tty, "(tty count=%d)\n", tty->count); tty_debug_hangup(tty, "opening (count=%d)\n", tty->count);
if (tty->ops->open) if (tty->ops->open)
retval = tty->ops->open(tty, filp); retval = tty->ops->open(tty, filp);
...@@ -2102,7 +2102,7 @@ static int tty_open(struct inode *inode, struct file *filp) ...@@ -2102,7 +2102,7 @@ static int tty_open(struct inode *inode, struct file *filp)
filp->f_flags = saved_flags; filp->f_flags = saved_flags;
if (retval) { if (retval) {
tty_debug_hangup(tty, "error %d, releasing...\n", retval); tty_debug_hangup(tty, "open error %d, releasing\n", retval);
tty_unlock(tty); /* need to call tty_release without BTM */ tty_unlock(tty); /* need to call tty_release without BTM */
tty_release(inode, filp); tty_release(inode, filp);
......
...@@ -216,7 +216,7 @@ int tty_unthrottle_safe(struct tty_struct *tty) ...@@ -216,7 +216,7 @@ int tty_unthrottle_safe(struct tty_struct *tty)
void tty_wait_until_sent(struct tty_struct *tty, long timeout) void tty_wait_until_sent(struct tty_struct *tty, long timeout)
{ {
tty_debug_wait_until_sent(tty, "\n"); tty_debug_wait_until_sent(tty, "wait until sent, timeout=%ld\n", timeout);
if (!timeout) if (!timeout)
timeout = MAX_SCHEDULE_TIMEOUT; timeout = MAX_SCHEDULE_TIMEOUT;
......
...@@ -669,8 +669,7 @@ static inline void proc_tty_unregister_driver(struct tty_driver *d) {} ...@@ -669,8 +669,7 @@ static inline void proc_tty_unregister_driver(struct tty_driver *d) {}
#define tty_msg(fn, tty, f, ...) \ #define tty_msg(fn, tty, f, ...) \
fn("%s %s: " f, tty_driver_name(tty), tty_name(tty), ##__VA_ARGS__) fn("%s %s: " f, tty_driver_name(tty), tty_name(tty), ##__VA_ARGS__)
#define tty_debug(tty, f, ...) \ #define tty_debug(tty, f, ...) tty_msg(pr_debug, tty, f, ##__VA_ARGS__)
tty_msg(pr_debug, tty, "%s:" f, __func__, ##__VA_ARGS__)
#define tty_info(tty, f, ...) tty_msg(pr_info, tty, f, ##__VA_ARGS__) #define tty_info(tty, f, ...) tty_msg(pr_info, tty, f, ##__VA_ARGS__)
#define tty_notice(tty, f, ...) tty_msg(pr_notice, tty, f, ##__VA_ARGS__) #define tty_notice(tty, f, ...) tty_msg(pr_notice, tty, f, ##__VA_ARGS__)
#define tty_warn(tty, f, ...) tty_msg(pr_warn, tty, f, ##__VA_ARGS__) #define tty_warn(tty, f, ...) tty_msg(pr_warn, tty, f, ##__VA_ARGS__)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment