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 2/3] tty: vcc: Drop unnecessary if block
Date: Fri, 15 Jan 2021 09:20:24 +0100 [thread overview]
Message-ID: <9a1c68fc-f3bf-79e7-e2ae-238059241e2f@kernel.org> (raw)
In-Reply-To: <20210114175718.137483-3-u.kleine-koenig@pengutronix.de>
On 14. 01. 21, 18:57, Uwe Kleine-König wrote:
> If vcc_probe() succeeded dev_set_drvdata() is called with a non-NULL
> value, and if vcc_probe() failed vcc_remove() isn't called.
>
> So there is no way dev_get_drvdata() can return NULL in vcc_remove() and
> the check can just go away.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
> ---
> drivers/tty/vcc.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c
> index 9ffd42e333b8..d9b0dc6deae9 100644
> --- a/drivers/tty/vcc.c
> +++ b/drivers/tty/vcc.c
> @@ -681,9 +681,6 @@ static int vcc_remove(struct vio_dev *vdev)
> {
> struct vcc_port *port = dev_get_drvdata(&vdev->dev);
>
> - if (!port)
> - return -ENODEV;
> -
> del_timer_sync(&port->rx_timer);
> del_timer_sync(&port->tx_timer);
>
>
--
js
next prev parent reply other threads:[~2021-01-15 8:24 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 [this message]
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
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=9a1c68fc-f3bf-79e7-e2ae-238059241e2f@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).