Skip to content

Commit

Permalink
lib: remove redundant assignment to variable ret
Browse files Browse the repository at this point in the history
The 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.

Link: https://lkml.kernel.org/r/20211230134557.83633-1-colin.i.king@gmail.com
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
ColinIanKing authored and torvalds committed Jan 20, 2022
1 parent 69d0db0 commit b1e78ef
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/asn1_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b1e78ef

Please sign in to comment.