From nobody Thu Jan 1 22:05:00 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DE93CDB483 for ; Wed, 18 Oct 2023 06:48:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229758AbjJRGsa (ORCPT ); Wed, 18 Oct 2023 02:48:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjJRGs3 (ORCPT ); Wed, 18 Oct 2023 02:48:29 -0400 Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9707B0 for ; Tue, 17 Oct 2023 23:48:26 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R931e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VuPuRWb_1697611697; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VuPuRWb_1697611697) by smtp.aliyun-inc.com; Wed, 18 Oct 2023 14:48:23 +0800 From: Jiapeng Chong 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 , Abaci Robot Subject: [PATCH] lib/vsprintf: Remove redundant code Date: Wed, 18 Oct 2023 14:48:17 +0800 Message-Id: <20231018064817.86721-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=3D6909 Signed-off-by: Jiapeng Chong --- 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 *add= r) i +=3D longest - 1; continue; } - if (needcolon) { + if (needcolon) *p++ =3D ':'; - needcolon =3D false; - } + /* hex u16 without leading 0s */ word =3D ntohs(in6.s6_addr16[i]); hi =3D word >> 8; --=20 2.20.1.7.g153144c