public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Colin King <colin.king@canonical.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: pty: remove redundant initialization of variable fd
Date: Fri, 14 May 2021 08:51:30 +0200	[thread overview]
Message-ID: <2f6c2e1e-770b-aade-cdcc-aa4010c36d5e@kernel.org> (raw)
In-Reply-To: <20210513221833.137672-1-colin.king@canonical.com>

On 14. 05. 21, 0:18, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable fd is being initialized with a value that is never
> read, it is being updated later on. The assignment is redundant and
> can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

> ---
>   drivers/tty/pty.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
> index 9b5d4ae5d8f2..2251330e7e00 100644
> --- a/drivers/tty/pty.c
> +++ b/drivers/tty/pty.c
> @@ -626,7 +626,7 @@ static struct cdev ptmx_cdev;
>    */
>   int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags)
>   {
> -	int fd = -1;
> +	int fd;
>   	struct file *filp;
>   	int retval = -EINVAL;
>   	struct path path;
> 


-- 
js
suse labs

      reply	other threads:[~2021-05-14  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13 22:18 [PATCH] tty: pty: remove redundant initialization of variable fd Colin King
2021-05-14  6:51 ` 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=2f6c2e1e-770b-aade-cdcc-aa4010c36d5e@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@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