From: Jiri Slaby <jirislaby@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
"David S . Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] tty: vcc: Drop impossible to hit WARN_ON
Date: Fri, 15 Jan 2021 09:20:44 +0100 [thread overview]
Message-ID: <046bdfe5-5741-0ebb-6cfd-2548f9a5543e@kernel.org> (raw)
In-Reply-To: <20210114175718.137483-4-u.kleine-koenig@pengutronix.de>
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@pengutronix.de>
Reviewed-by: Jiri Slaby <jirislaby@kernel.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
prev parent reply other threads:[~2021-01-15 8:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-14 17:57 [PATCH 0/3] tty: some cleanups in remove functions Uwe Kleine-König
2021-01-14 17:57 ` [PATCH 1/3] tty: hvcs: Drop unnecessary if block Uwe Kleine-König
2021-01-15 8:19 ` Jiri Slaby
2021-01-20 17:16 ` Tyrel Datwyler
2021-01-14 17:57 ` [PATCH 2/3] tty: vcc: " Uwe Kleine-König
2021-01-15 8:20 ` Jiri Slaby
2021-01-14 17:57 ` [PATCH 3/3] tty: vcc: Drop impossible to hit WARN_ON Uwe Kleine-König
2021-01-15 8:20 ` Jiri Slaby [this message]
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=046bdfe5-5741-0ebb-6cfd-2548f9a5543e@kernel.org \
--to=jirislaby@kernel.org \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sparclinux@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).