[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <046bdfe5-5741-0ebb-6cfd-2548f9a5543e@kernel.org>
Date: Fri, 15 Jan 2021 09:20:44 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: "David S . Miller" <davem@...emloft.net>,
linuxppc-dev@...ts.ozlabs.org, sparclinux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] tty: vcc: Drop impossible to hit WARN_ON
On 14. 01. 21, 18:57, Uwe Kleine-König wrote:
> vcc_get() returns the port that has provided port->index. As the port that
> is about to be removed isn't removed yet this trivially will find this
> port. So simplify the call to not assign an identical value to the port
> pointer and drop the warning that is never hit.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Reviewed-by: Jiri Slaby <jirislaby@...nel.org>
> ---
> drivers/tty/vcc.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c
> index d9b0dc6deae9..e2d6205f83ce 100644
> --- a/drivers/tty/vcc.c
> +++ b/drivers/tty/vcc.c
> @@ -692,12 +692,9 @@ static int vcc_remove(struct vio_dev *vdev)
> tty_vhangup(port->tty);
>
> /* Get exclusive reference to VCC, ensures that there are no other
> - * clients to this port
> + * clients to this port. This cannot fail.
> */
> - port = vcc_get(port->index, true);
> -
> - if (WARN_ON(!port))
> - return -ENODEV;
> + vcc_get(port->index, true);
>
> tty_unregister_device(vcc_tty_driver, port->index);
>
>
--
js
Powered by blists - more mailing lists