From: Colin Ian King <colin.king@canonical.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
linux-serial@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/tty: emove redundant assignment to variable i and rename it to ret
Date: Sun, 5 Apr 2020 14:35:43 +0100 [thread overview]
Message-ID: <dd83c6dc-da74-e961-4a25-b6515742052a@canonical.com> (raw)
In-Reply-To: <20200405133013.380080-1-colin.king@canonical.com>
Oops, typo on $SUBJECT, can "emove" be replaced with "remove" when this
is applied?
On 05/04/2020 14:30, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable i is being assigned a value that is never read
> and it is being updated later with a new value. The assignment
> is redundant and can be removed. Also rename i to ret as this new
> name makes makes more sense.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/tty/serial/8250/serial_cs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
> index c8186a05a453..e3d10794dbba 100644
> --- a/drivers/tty/serial/8250/serial_cs.c
> +++ b/drivers/tty/serial/8250/serial_cs.c
> @@ -440,7 +440,7 @@ static int simple_config_check_notpicky(struct pcmcia_device *p_dev,
> static int simple_config(struct pcmcia_device *link)
> {
> struct serial_info *info = link->priv;
> - int i = -ENODEV, try;
> + int ret, try;
>
> /*
> * First pass: look for a config entry that looks normal.
> @@ -472,8 +472,8 @@ static int simple_config(struct pcmcia_device *link)
> if (info->quirk && info->quirk->config)
> info->quirk->config(link);
>
> - i = pcmcia_enable_device(link);
> - if (i != 0)
> + ret = pcmcia_enable_device(link);
> + if (ret != 0)
> return -1;
> return setup_serial(link, info, link->resource[0]->start, link->irq);
> }
>
next prev parent reply other threads:[~2020-04-05 13:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-05 13:30 Colin King
2020-04-05 13:35 ` Colin Ian King [this message]
2020-04-05 13:50 ` Greg Kroah-Hartman
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=dd83c6dc-da74-e961-4a25-b6515742052a@canonical.com \
--to=colin.king@canonical.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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
all inboxes | Powered by JetHome®