From: Greg KH <gregkh@linuxfoundation.org>
To: "tiantao (H)" <tiantao6@huawei.com>
Cc: Tian Tao <tiantao6@hisilicon.com>,
jirislaby@kernel.org, linux-samsung-soc@vger.kernel.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH] tty: serial: samsung_tty: remove set but not used variables
Date: Fri, 23 Apr 2021 12:14:24 +0200 [thread overview]
Message-ID: <YIKeAFbqyl00tHXH@kroah.com> (raw)
In-Reply-To: <660e8905-6c5c-e076-5211-a87a62ea5c87@huawei.com>
On Fri, Apr 23, 2021 at 05:54:16PM +0800, tiantao (H) wrote:
>
> 在 2021/4/23 17:47, Greg KH 写道:
> > On Fri, Apr 23, 2021 at 05:39:00PM +0800, Tian Tao wrote:
> > > The value of 'ret' is not used, so just delete it.
> > >
> > > Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> > > ---
> > > drivers/tty/serial/samsung_tty.c | 1 -
> > > 1 file changed, 1 deletion(-)
> > >
> > > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> > > index d9e4b67..d269d75 100644
> > > --- a/drivers/tty/serial/samsung_tty.c
> > > +++ b/drivers/tty/serial/samsung_tty.c
> > > @@ -2220,7 +2220,6 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
> > > default:
> > > dev_warn(&pdev->dev, "unsupported reg-io-width (%d)\n",
> > > prop);
> > > - ret = -EINVAL;
> > That looks odd, shouldn't you do something with this instead of ignoring
> > it???
>
> How about this ?
>
> diff --git a/drivers/tty/serial/samsung_tty.c
> b/drivers/tty/serial/samsung_tty.c
> index d9e4b67..9fbc611 100644
> --- a/drivers/tty/serial/samsung_tty.c
> +++ b/drivers/tty/serial/samsung_tty.c
> @@ -2220,8 +2220,7 @@ static int s3c24xx_serial_probe(struct platform_device
> *pdev)
> default:
> dev_warn(&pdev->dev, "unsupported
> reg-io-width (%d)\n",
> prop);
> - ret = -EINVAL;
> - break;
> + return -EINVAL;
>
You tell me, does the patch work for you?
Is this really a "hard error" and did you now just break devices that
used to work properly? Are you correctly unwinding any previously
allocated state when you return here?
Please do some research on this, and ideally, lots of testing, before
submitting it as a real solution.
thanks,
greg k-h
next prev parent reply other threads:[~2021-04-23 10:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-23 9:39 [PATCH] tty: serial: samsung_tty: remove set but not used variables Tian Tao
2021-04-23 9:47 ` Greg KH
2021-04-23 9:54 ` tiantao (H)
2021-04-23 10:14 ` Greg KH [this message]
2021-04-26 6:45 ` Krzysztof Kozlowski
2021-04-26 6:56 ` Greg KH
2021-04-26 6:57 ` Krzysztof Kozlowski
2021-04-23 9:55 ` 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=YIKeAFbqyl00tHXH@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=tiantao6@hisilicon.com \
--cc=tiantao6@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.