public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 05/13] tty: remove tty_warn()
Date: Thu,  8 Apr 2021 14:51:26 +0200	[thread overview]
Message-ID: <20210408125134.3016837-6-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <20210408125134.3016837-1-gregkh@linuxfoundation.org>

Remove users of tty_warn() and replace them with calls to dev_warn()
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/n_tty.c       | 2 +-
 drivers/tty/tty.h         | 1 -
 drivers/tty/tty_io.c      | 8 ++++----
 drivers/tty/tty_jobctrl.c | 2 +-
 drivers/tty/tty_port.c    | 4 ++--
 5 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index dbe208342258..39a448ef0aed 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1200,7 +1200,7 @@ static void n_tty_receive_overrun(struct tty_struct *tty)
 	ldata->num_overrun++;
 	if (time_after(jiffies, ldata->overrun_time + HZ) ||
 			time_after(ldata->overrun_time, jiffies)) {
-		tty_warn(tty, "%d input overrun(s)\n", ldata->num_overrun);
+		dev_warn(tty->dev, "%d input overrun(s)\n", ldata->num_overrun);
 		ldata->overrun_time = jiffies;
 		ldata->num_overrun = 0;
 	}
diff --git a/drivers/tty/tty.h b/drivers/tty/tty.h
index 0323bc2cd6ba..45b15cc250e8 100644
--- a/drivers/tty/tty.h
+++ b/drivers/tty/tty.h
@@ -10,7 +10,6 @@
 	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__)
-#define tty_warn(tty, f, ...)	tty_msg(pr_warn, tty, f, ##__VA_ARGS__)
 
 #define tty_info_ratelimited(tty, f, ...) \
 		tty_msg(pr_info_ratelimited, tty, f, ##__VA_ARGS__)
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 0079ffd0cb9c..2c3efa854ba5 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -295,7 +295,7 @@ static int check_tty_count(struct tty_struct *tty, const char *routine)
 	if (tty_port_kopened(tty->port))
 		kopen_count++;
 	if (tty->count != (count + kopen_count)) {
-		tty_warn(tty, "%s: tty->count(%d) != (#fd's(%d) + #kopen's(%d))\n",
+		dev_warn(tty->dev, "%s: tty->count(%d) != (#fd's(%d) + #kopen's(%d))\n",
 			 routine, tty->count, count, kopen_count);
 		return (count + kopen_count);
 	}
@@ -1823,7 +1823,7 @@ int tty_release(struct inode *inode, struct file *filp)
 
 		if (once) {
 			once = 0;
-			tty_warn(tty, "read/write wait queue active!\n");
+			dev_warn(tty->dev, "read/write wait queue active!\n");
 		}
 		schedule_timeout_killable(timeout);
 		if (timeout < 120 * HZ)
@@ -1834,12 +1834,12 @@ int tty_release(struct inode *inode, struct file *filp)
 
 	if (o_tty) {
 		if (--o_tty->count < 0) {
-			tty_warn(tty, "bad slave count (%d)\n", o_tty->count);
+			dev_warn(tty->dev, "bad slave count (%d)\n", o_tty->count);
 			o_tty->count = 0;
 		}
 	}
 	if (--tty->count < 0) {
-		tty_warn(tty, "bad tty->count (%d)\n", tty->count);
+		dev_warn(tty->dev, "bad tty->count (%d)\n", tty->count);
 		tty->count = 0;
 	}
 
diff --git a/drivers/tty/tty_jobctrl.c b/drivers/tty/tty_jobctrl.c
index 0728730d38d1..19ec43a6ef76 100644
--- a/drivers/tty/tty_jobctrl.c
+++ b/drivers/tty/tty_jobctrl.c
@@ -61,7 +61,7 @@ int __tty_check_change(struct tty_struct *tty, int sig)
 	rcu_read_unlock();
 
 	if (!tty_pgrp)
-		tty_warn(tty, "sig=%d, tty->pgrp == NULL!\n", sig);
+		dev_warn(tty->dev, "sig=%d, tty->pgrp == NULL!\n", sig);
 
 	return ret;
 }
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index 303c198fbf5c..575fe3933ff9 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -567,12 +567,12 @@ int tty_port_close_start(struct tty_port *port,
 
 	spin_lock_irqsave(&port->lock, flags);
 	if (tty->count == 1 && port->count != 1) {
-		tty_warn(tty, "%s: tty->count = 1 port count = %d\n", __func__,
+		dev_warn(tty->dev, "%s: tty->count = 1 port count = %d\n", __func__,
 			 port->count);
 		port->count = 1;
 	}
 	if (--port->count < 0) {
-		tty_warn(tty, "%s: bad port count (%d)\n", __func__,
+		dev_warn(tty->dev, "%s: bad port count (%d)\n", __func__,
 			 port->count);
 		port->count = 0;
 	}
-- 
2.31.1


  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 ` Greg Kroah-Hartman [this message]
2021-04-08 13:47   ` [PATCH 05/13] tty: remove tty_warn() 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 ` [PATCH 07/13] tty: remove tty_debug() Greg Kroah-Hartman
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-6-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