From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: pmladek@suse.com
Cc: rostedt@goodmis.org, andriy.shevchenko@linux.intel.com,
linux@rasmusvillemoes.dk, senozhatsky@chromium.org,
linux-kernel@vger.kernel.org,
Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH] lib/vsprintf: Remove redundant code
Date: Wed, 18 Oct 2023 14:48:17 +0800 [thread overview]
Message-ID: <20231018064817.86721-1-jiapeng.chong@linux.alibaba.com> (raw)
When variable needcolon is assigned a value of false, it must be
assigned a value of true later on, which is redundant code.
lib/vsprintf.c:1411:4: warning: Value stored to 'needcolon' is never read.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6909
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
lib/vsprintf.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index afb88b24fa74..9a9086885da8 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1406,10 +1406,9 @@ char *ip6_compressed_string(char *p, const char *addr)
i += longest - 1;
continue;
}
- if (needcolon) {
+ if (needcolon)
*p++ = ':';
- needcolon = false;
- }
+
/* hex u16 without leading 0s */
word = ntohs(in6.s6_addr16[i]);
hi = word >> 8;
--
2.20.1.7.g153144c
next reply other threads:[~2023-10-18 6:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 6:48 Jiapeng Chong [this message]
2023-10-18 12:56 ` Andy Shevchenko
2023-10-19 11:51 ` Rasmus Villemoes
2023-10-19 12:21 ` Andy Shevchenko
2023-10-19 13:21 ` Petr Mladek
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=20231018064817.86721-1-jiapeng.chong@linux.alibaba.com \
--to=jiapeng.chong@linux.alibaba.com \
--cc=abaci@linux.alibaba.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.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®