mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lib: remove redundant assignment to variable ret
Date: Thu, 6 Jan 2022 21:03:44 +0200	[thread overview]
Message-ID: <Ydc9EHZAqSgS4hol@iki.fi> (raw)
In-Reply-To: <20211230134557.83633-1-colin.i.king@gmail.com>

On Thu, Dec 30, 2021 at 01:45:57PM +0000, Colin Ian King wrote:
> Variable ret is being assigned a value that is never read. If the
> for-loop is entered then ret is immediately re-assigned a new
> value. If the for-loop is not executed ret is never read. The
> assignment is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>


Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

BR,
Jarkko

> ---
>  lib/asn1_encoder.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/lib/asn1_encoder.c b/lib/asn1_encoder.c
> index 27bbe891714f..0fd3c454a468 100644
> --- a/lib/asn1_encoder.c
> +++ b/lib/asn1_encoder.c
> @@ -164,8 +164,6 @@ asn1_encode_oid(unsigned char *data, const unsigned char *end_data,
>  
>  	data_len -= 3;
>  
> -	ret = 0;
> -
>  	for (i = 2; i < oid_len; i++) {
>  		ret = asn1_encode_oid_digit(&d, &data_len, oid[i]);
>  		if (ret < 0)
> -- 
> 2.33.1
> 

      reply	other threads:[~2022-01-06 19:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-30 13:45 Colin Ian King
2022-01-06 19:03 ` Jarkko Sakkinen [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=Ydc9EHZAqSgS4hol@iki.fi \
    --to=jarkko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=colin.i.king@gmail.com \
    --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

all inboxes | Powered by JetHome®