Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp769188rdb; Sat, 6 Jan 2024 08:14:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGunlrfwMT0x8KeYgUOV5KphwaBuROVJtW2JCDU1kANP+tF2djrCxiL6o7XEOi/mFGLE9vy X-Received: by 2002:ac8:7d05:0:b0:429:767a:98c7 with SMTP id g5-20020ac87d05000000b00429767a98c7mr1553474qtb.89.1704557645391; Sat, 06 Jan 2024 08:14:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704557645; cv=none; d=google.com; s=arc-20160816; b=trhjEc2OqW3OIUnmf6Gq7m3enAl7itVD79sW40i/EaurCMqilGURepAILGGyTto+Ce bEqlh2f9ktg7cnRsP+QZOKi8IgKROLKmOILHT9tZeiPUZDr02Ke2xEhT3xT5PEFQMJCT VaSDhezyTM8cUUbHqo3dJ03srC3rwcTlRLbm023APzXp72aW7VYedf6fQC+i+0WLcRJb 4pdUTjYLAS3q2lGzIWay2t80iF/EEZ0sYuZynujwUuEoX05DUEmYzGSmHgwEX9ipXm3b Yh8mRvRzNOIHMnq8NZf5Btc3Zgw4kQx3q15Mb35Ph489LfJdsb1nqLVx1t2CB8L4Nmbi tFNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=bP9/hyp+Ar4796H7vl3kIIXqyZbFt9cbUnhaNA2fvi4=; fh=ulD8iPhwZFmmPc+sJfV47KRA+BAU1LADd1ULnEKWZqw=; b=K4WhspBHmVHKbvzaGYOL6Bh7rbNk84GiymxtB1sgnLsrdWVt44R+8xRpyDmCjF1qFh 82IKrs0HKsDdwsPHHagvblx/Ve/kREnKdGyDcfVLvZ8ln/PvLVtAy3tDxgZdfuGp4+g0 urZuf4g6mo7eH99vGgL8pUAxTj1ypxdQPKmmNpgPeGpzYt4nFrH2F8MrEfecCg9ZWcwJ iK1glFTqAJ/BckaDat1U85Pvt/ML7HM9ik0sXIq6Y67Zqoyt8Db8o2Q+bkZnBXblAVAJ vFA4I19wYOwopxyeVgm7ALyODkgfaro5hCwv6ZJhkSspaniRUXuMHvn07hUgYUAalK9J Qr6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pnRXAGLA; spf=pass (google.com: domain of linux-kernel+bounces-18652-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18652-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d18-20020ac85d92000000b004277e13bab3si4066485qtx.500.2024.01.06.08.14.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 08:14:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18652-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pnRXAGLA; spf=pass (google.com: domain of linux-kernel+bounces-18652-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18652-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 298FA1C20E90 for ; Sat, 6 Jan 2024 16:14:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 822FE882F; Sat, 6 Jan 2024 16:13:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pnRXAGLA" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFC0D846F; Sat, 6 Jan 2024 16:13:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B132FC433C8; Sat, 6 Jan 2024 16:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704557635; bh=XjvIgbYcLNiCPkQTGelWcqBIIVCUpLezTCqf4WDSr7s=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=pnRXAGLAzveDRtfyVpbEr8/WJp7ZmsJrEOnBHSFkWr1Vd/LVFaE81vlN8AtobqrZr rHfpsrasqFspuH8W5jZyx7DQNvYH0ZQ1M03WnXZWZ8A3WAWvwjvm0//S70hyFPxu0a UBSfedo+7YoTBRB2E657TLu9NAp4Vid69oZPnbCD1j+NstfHUrRn0ffMEs8yoqpOpk +YEGF3IROcDukWG5yfhux248hN/sBEdBglro9ArxmknECgkMq/MJ+bfhWY3egzhdIh s+t/wseTVB22CEgLiQsN6U+WMBHb0R2G8pINYVo+Z2uFKQaMbNJYXWvqXPKAhkvQLG 3qiRzT5hw1/+Q== Message-ID: <8ae4f9b0-1917-448d-a89b-11597549f89b@kernel.org> Date: Sat, 6 Jan 2024 09:13:53 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next] net/ipv6: resolve warning in ip6_fib.c Content-Language: en-US To: Breno Leitao , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: leit@meta.com, "open list:NETWORKING [IPv4/IPv6]" , open list , "open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b" , Wei Wang References: <20240105173920.1041474-1-leitao@debian.org> From: David Ahern In-Reply-To: <20240105173920.1041474-1-leitao@debian.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/5/24 10:39 AM, Breno Leitao wrote: > In some configurations, the 'iter' variable in function > fib6_repair_tree() is unused, resulting the following warning when > compiled with W=1. > > net/ipv6/ip6_fib.c:1781:6: warning: variable 'iter' set but not used [-Wunused-but-set-variable] > 1781 | int iter = 0; > | ^ > > Rewrite RT6_TRACE() macro to keep the variable in scope. > > Clang 18 removes the trace completely from the binary when the trace is > disabled[1], so, no overhead is expected with this change. > > [1] Link: https://paste.debian.net/1303162/ > > Signed-off-by: Breno Leitao > --- > include/net/ip6_fib.h | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h > index 9ba6413fd2e3..d2ef60ebeb25 100644 > --- a/include/net/ip6_fib.h > +++ b/include/net/ip6_fib.h > @@ -30,11 +30,7 @@ > > #define RT6_DEBUG 2 > > -#if RT6_DEBUG >= 3 > -#define RT6_TRACE(x...) pr_debug(x) > -#else > -#define RT6_TRACE(x...) do { ; } while (0) > -#endif > +#define RT6_TRACE(x...) do { if (RT6_DEBUG > 3) pr_debug(x); } while (0) > > struct rt6_info; > struct fib6_info; I question the value of RT6_TRACE vs just using pr_debug; pr_debug has zero cost until enabled and can be enabled by file or line. Not requiring a kernel build is actual better. [cc'ed Wei who added the macro]