public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Arnd Bergmann <arnd@arndb.de>, Petr Mladek <pmladek@suse.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] tty: remove duplicate hung_up_tty_compat_ioctl()
Date: Sat, 29 Apr 2023 22:34:31 +0200	[thread overview]
Message-ID: <20230429203523.538756-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

The hung_up_tty_compat_ioctl() has been identical to hung_up_tty_ioctl()
for a very long time, but now the only caller is inside of an #ifdef,
causing a harmless warning:

drivers/tty/tty_io.c:446:13: error: 'hung_up_tty_compat_ioctl' defined but not used [-Werror=unused-function]
  446 | static long hung_up_tty_compat_ioctl(struct file *file,

Avoid this by removing the function entirely and just using the native
one in its place.

Fixes: 04f378b198da ("tty: BKL pushdown")
Fixes: 4c87e9e5479b ("tty: tty_io: remove hung_up_tty_fops")
Link: https://lore.kernel.org/all/2a07bded-25e5-fd27-a2de-8b606e4d1d2c@I-love.SAKURA.ne.jp/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I did this patch to fix the build failure locally before I saw it
was already under discussion. Sending it anyway in case nobody
else has done a formal fix yet.
---
 drivers/tty/tty_io.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 553182753098..31d465279b6c 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -443,12 +443,6 @@ static long hung_up_tty_ioctl(struct file *file, unsigned int cmd,
 	return cmd == TIOCSPGRP ? -ENOTTY : -EIO;
 }
 
-static long hung_up_tty_compat_ioctl(struct file *file,
-				     unsigned int cmd, unsigned long arg)
-{
-	return cmd == TIOCSPGRP ? -ENOTTY : -EIO;
-}
-
 static int hung_up_tty_fasync(int fd, struct file *file, int on)
 {
 	return -ENOTTY;
@@ -2941,7 +2935,7 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd,
 	}
 
 	if (tty_hung_up_p(file))
-		return hung_up_tty_compat_ioctl(file, cmd, arg);
+		return hung_up_tty_ioctl(file, cmd, arg);
 	if (tty_paranoia_check(tty, file_inode(file), "tty_ioctl"))
 		return -EINVAL;
 
@@ -2959,7 +2953,7 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd,
 
 	ld = tty_ldisc_ref_wait(tty);
 	if (!ld)
-		return hung_up_tty_compat_ioctl(file, cmd, arg);
+		return hung_up_tty_ioctl(file, cmd, arg);
 	if (ld->ops->compat_ioctl)
 		retval = ld->ops->compat_ioctl(tty, cmd, arg);
 	if (retval == -ENOIOCTLCMD && ld->ops->ioctl)
-- 
2.39.2


             reply	other threads:[~2023-04-29 20:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-29 20:34 Arnd Bergmann [this message]
2023-05-02  5:04 ` [PATCH] tty: remove duplicate hung_up_tty_compat_ioctl() Jiri Slaby

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=20230429203523.538756-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=pmladek@suse.com \
    /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