[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231018064817.86721-1-jiapeng.chong@linux.alibaba.com>
Date: Wed, 18 Oct 2023 14:48:17 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: pmladek@...e.com
Cc: rostedt@...dmis.org, andriy.shevchenko@...ux.intel.com,
linux@...musvillemoes.dk, senozhatsky@...omium.org,
linux-kernel@...r.kernel.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
Abaci Robot <abaci@...ux.alibaba.com>
Subject: [PATCH] lib/vsprintf: Remove redundant code
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@...ux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6909
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.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
Powered by blists - more mailing lists