From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
Jiri Slaby <jirislaby@kernel.org>
Subject: [PATCH 07/13] tty: remove tty_debug()
Date: Thu, 8 Apr 2021 14:51:28 +0200 [thread overview]
Message-ID: <20210408125134.3016837-8-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <20210408125134.3016837-1-gregkh@linuxfoundation.org>
Remove users of tty_debug() and replace them with calls to dev_dbg()
which provides more information about the tty that has the error and
uses the standard formatting logic.
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/pty.c | 2 +-
drivers/tty/tty.h | 5 -----
drivers/tty/tty_io.c | 14 +++++++-------
drivers/tty/tty_ioctl.c | 2 +-
drivers/tty/tty_jobctrl.c | 4 ++--
drivers/tty/tty_ldisc.c | 2 +-
6 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 6c90d3fd2d51..5695c78fbe55 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -33,7 +33,7 @@
#undef TTY_DEBUG_HANGUP
#ifdef TTY_DEBUG_HANGUP
-# define tty_debug_hangup(tty, f, args...) tty_debug(tty, f, ##args)
+# define tty_debug_hangup(tty, f, args...) dev_dbg(tty->dev, f, ##args)
#else
# define tty_debug_hangup(tty, f, args...) do {} while (0)
#endif
diff --git a/drivers/tty/tty.h b/drivers/tty/tty.h
index a2084b58d4f3..e9cb918348cf 100644
--- a/drivers/tty/tty.h
+++ b/drivers/tty/tty.h
@@ -6,9 +6,4 @@
#ifndef _TTY_INTERNAL_H
#define _TTY_INTERNAL_H
-#define tty_msg(fn, tty, f, ...) \
- fn("%s %s: " f, tty_driver_name(tty), tty_name(tty), ##__VA_ARGS__)
-
-#define tty_debug(tty, f, ...) tty_msg(pr_debug, tty, f, ##__VA_ARGS__)
-
#endif
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 91062fcc6667..1c480c04374c 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -112,7 +112,7 @@
#undef TTY_DEBUG_HANGUP
#ifdef TTY_DEBUG_HANGUP
-# define tty_debug_hangup(tty, f, args...) tty_debug(tty, f, ##args)
+# define tty_debug_hangup(tty, f, args...) dev_dbg(tty->dev, f, ##args)
#else
# define tty_debug_hangup(tty, f, args...) do { } while (0)
#endif
@@ -1639,7 +1639,7 @@ static int tty_release_checks(struct tty_struct *tty, int idx)
{
#ifdef TTY_PARANOIA_CHECK
if (idx < 0 || idx >= tty->driver->num) {
- tty_debug(tty, "bad idx %d\n", idx);
+ dev_dbg(tty->dev, "bad idx %d\n", idx);
return -1;
}
@@ -1648,20 +1648,20 @@ static int tty_release_checks(struct tty_struct *tty, int idx)
return 0;
if (tty != tty->driver->ttys[idx]) {
- tty_debug(tty, "bad driver table[%d] = %p\n",
- idx, tty->driver->ttys[idx]);
+ dev_dbg(tty->dev, "bad driver table[%d] = %p\n",
+ idx, tty->driver->ttys[idx]);
return -1;
}
if (tty->driver->other) {
struct tty_struct *o_tty = tty->link;
if (o_tty != tty->driver->other->ttys[idx]) {
- tty_debug(tty, "bad other table[%d] = %p\n",
- idx, tty->driver->other->ttys[idx]);
+ dev_dbg(tty->dev, "bad other table[%d] = %p\n",
+ idx, tty->driver->other->ttys[idx]);
return -1;
}
if (o_tty->link != tty) {
- tty_debug(tty, "bad link = %p\n", o_tty->link);
+ dev_dbg(tty->dev, "bad link = %p\n", o_tty->link);
return -1;
}
}
diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index 4de1c6ddb8ff..053290ab5cb8 100644
--- a/drivers/tty/tty_ioctl.c
+++ b/drivers/tty/tty_ioctl.c
@@ -28,7 +28,7 @@
#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)
+# define tty_debug_wait_until_sent(tty, f, args...) dev_dbg(tty->dev, f, ##args)
#else
# define tty_debug_wait_until_sent(tty, f, args...) do {} while (0)
#endif
diff --git a/drivers/tty/tty_jobctrl.c b/drivers/tty/tty_jobctrl.c
index 19ec43a6ef76..bbc404255291 100644
--- a/drivers/tty/tty_jobctrl.c
+++ b/drivers/tty/tty_jobctrl.c
@@ -109,8 +109,8 @@ static void __proc_set_tty(struct tty_struct *tty)
tty->session = get_pid(task_session(current));
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
if (current->signal->tty) {
- tty_debug(tty, "current tty %s not NULL!!\n",
- current->signal->tty->name);
+ dev_dbg(tty->dev, "current tty %s not NULL!!\n",
+ current->signal->tty->name);
tty_kref_put(current->signal->tty);
}
put_pid(current->signal->tty_old_pgrp);
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 2e8da820c303..b2e821e14a13 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -24,7 +24,7 @@
#undef LDISC_DEBUG_HANGUP
#ifdef LDISC_DEBUG_HANGUP
-#define tty_ldisc_debug(tty, f, args...) tty_debug(tty, f, ##args)
+#define tty_ldisc_debug(tty, f, args...) dev_dbg(tty->dev, f, ##args)
#else
#define tty_ldisc_debug(tty, f, args...)
#endif
--
2.31.1
next prev parent reply other threads:[~2021-04-08 12:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 12:51 [PATCH 00/13] tty.h cleanups Greg Kroah-Hartman
2021-04-08 12:51 ` [PATCH 01/13] tty: create internal tty.h file Greg Kroah-Hartman
2021-04-08 12:51 ` [PATCH 02/13] tty: tty.h: remove tty_info() Greg Kroah-Hartman
2021-04-08 12:51 ` [PATCH 03/13] tty: remove tty_err() Greg Kroah-Hartman
2021-04-08 12:51 ` [PATCH 04/13] tty: remove tty_notice() Greg Kroah-Hartman
2021-04-08 12:51 ` [PATCH 05/13] tty: remove tty_warn() Greg Kroah-Hartman
2021-04-08 13:47 ` Tetsuo Handa
2021-04-08 18:03 ` Greg Kroah-Hartman
2021-04-08 12:51 ` [PATCH 06/13] tty: remove tty_info_ratelimited() Greg Kroah-Hartman
2021-04-08 12:51 ` Greg Kroah-Hartman [this message]
2021-04-08 12:51 ` [PATCH 08/13] tty: audit: move some local functions out of tty.h Greg Kroah-Hartman
2021-04-08 12:51 ` [PATCH 09/13] tty: move some internal tty lock enums and " Greg Kroah-Hartman
2021-04-08 12:51 ` [PATCH 10/13] tty: make tty_release_redirect() static Greg Kroah-Hartman
2021-04-08 12:51 ` [PATCH 11/13] tty: move some tty-only functions to drivers/tty/tty.h Greg Kroah-Hartman
2021-04-08 12:51 ` [PATCH 12/13] tty: remove tty_driver_name() Greg Kroah-Hartman
2021-04-08 12:51 ` [PATCH 13/13] tty: clean include/linux/tty.h up Greg Kroah-Hartman
2021-04-08 17:51 ` Greg Kroah-Hartman
2021-04-08 14:25 ` [PATCH 00/13] tty.h cleanups Johan Hovold
2021-04-08 18:01 ` Greg Kroah-Hartman
2021-04-09 7:32 ` Johan Hovold
2021-04-15 8:21 ` Greg Kroah-Hartman
2021-04-15 14:14 ` Johan Hovold
2021-04-15 14:53 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210408125134.3016837-8-gregkh@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox