[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c8f74500-c383-b179-d1e6-71c231030a04@kernel.org>
Date: Tue, 2 May 2023 07:04:20 +0200
From: Jiri Slaby <jirislaby@...nel.org>
To: Arnd Bergmann <arnd@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Cc: Arnd Bergmann <arnd@...db.de>, Petr Mladek <pmladek@...e.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tty: remove duplicate hung_up_tty_compat_ioctl()
On 29. 04. 23, 22:34, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.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@...db.de>
Reviewed-by: Jiri Slaby <jirislaby@...nel.org>
> ---
> 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)
--
js
suse labs
Powered by blists - more mailing lists