From: Colin Ian King <colin.i.king@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
Stefan Berger <stefanb@linux.ibm.com>
Cc: kernel-janitors@vger.kernel.org,
Nathan Chancellor <nathan@kernel.org>,
llvm@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] lib/oid_registry.c: remove redundant assignment to variable num
Date: Thu, 30 Dec 2021 15:09:03 +0000 [thread overview]
Message-ID: <20211230150903.190860-1-colin.i.king@gmail.com> (raw)
The variable num is being assigned a value that is never read, it
is being re-assigned a value in both paths of the following if
statement. The assignment is redundant and can be removed.
Cleans up clang-scan warning:
lib/oid_registry.c:149:3: warning: Value stored to 'num' is never
read [deadcode.DeadStores]
num = 0;
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
lib/oid_registry.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/oid_registry.c b/lib/oid_registry.c
index e592d48b1974..fe6705cfd780 100644
--- a/lib/oid_registry.c
+++ b/lib/oid_registry.c
@@ -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;
--
2.33.1
next reply other threads:[~2021-12-30 15:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-30 15:09 Colin Ian King [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-10-10 20:42 [PATCH] lib/oid_registry.c: Remove redundant assignment to variable num Colin Ian King
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=20211230150903.190860-1-colin.i.king@gmail.com \
--to=colin.i.king@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=stefanb@linux.ibm.com \
/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