]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
lib/oid_registry.c: remove redundant assignment to variable num
authorColin Ian King <colin.i.king@gmail.com>
Mon, 17 Oct 2022 21:45:56 +0000 (22:45 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 18 Nov 2022 21:55:06 +0000 (13:55 -0800)
The variable num is being assigned a value that is never read, it is being
re-assigned a new value in both paths if an if-statement.  The assignment
is redundant and can be removed.

Cleans up clang scan build warning:
lib/oid_registry.c:149:3: warning: Value stored to 'num' is
never read [deadcode.DeadStores]

Link: https://lkml.kernel.org/r/20221017214556.863357-1-colin.i.king@gmail.com
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/oid_registry.c

index e592d48b1974a0be9bd2e56c3a138cf81635f269..fe6705cfd780e32307639ec559bfff2d13f5079a 100644 (file)
@@ -146,7 +146,6 @@ int sprint_oid(const void *data, size_t datasize, char *buffer, size_t bufsize)
        bufsize -= count;
 
        while (v < end) {
-               num = 0;
                n = *v++;
                if (!(n & 0x80)) {
                        num = n;