]> git.baikalelectronics.ru Git - kernel.git/commitdiff
lib: remove redundant assignment to variable ret
authorColin Ian King <colin.i.king@gmail.com>
Thu, 20 Jan 2022 02:10:38 +0000 (18:10 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 Jan 2022 06:52:55 +0000 (08:52 +0200)
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>
lib/asn1_encoder.c

index 27bbe891714f914cadcec73d9407687c7ef2a405..0fd3c454a4689bc73f82204392347dcf242d09c4 100644 (file)
@@ -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)