Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp284899rdb; Fri, 5 Jan 2024 09:40:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXMEDRjdvAiN5cDGA6qpPzcWejMWTrsmqNkJgZUzS7HNPEyLqHbuyrLGI3TQcUezeuhe+o X-Received: by 2002:a05:6e02:1b8a:b0:35f:f035:3237 with SMTP id h10-20020a056e021b8a00b0035ff0353237mr2592367ili.88.1704476427738; Fri, 05 Jan 2024 09:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704476427; cv=none; d=google.com; s=arc-20160816; b=G5vI0wdHGQE5LyzxqEADxX8YvrAdy78uE9ZY2UOYdZ7H/BqDedwRxSZazSVfGDf8vs a/rbTf+FCi7tBpeWTF31Au7MoYy8HKe08Jeb93c+e5j4U4mIXFx3Jk2jXjleHm4isljP ZlPwtH7Xv+ggwoxCrJ+ioi5NRFYlMbpqbtiCoQ61gBzQPtYQWmrmLAKpT/ZkfqLqf5sz GOfspOHlOp3rf96FulGq+IM5mOoXFWMdGyDBTAXnEkKCMJ6u1F9f0LjbAddhPWlMIVLX bncdIHOOkb0ZccAnTFawsTbJ0q6kcH7nBRLhqruq0COx8mDiayUMATaqG66ckBfoezf/ K97w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=RJ864dYz0Y/ieesbskVDxoJcEEeyC5EY2kKFTREupmw=; fh=dDhQgk8ElrF5NVYlvCT6mtuo850tOK1rOkspycYcb2A=; b=gBL1FBLGq1WUVwnE3m5+DYGcyvyA5Nq0Yoq3uKO1xSRArBbG7moA73LJPwXV0/wYUQ cj1PJMeHjCeBryWPhG+pNBYiMmPcRVVoznb3d25ZlUDuxGXDQu//95QOzvCLgZHIaxip lS4vZLtunQnbYI4D/gkYbSfdaeJYP9XCRsS6vCdxej3YjLXJcdz2NQnGCjl5GnU8hZ2O spJYraFO6Sh9qcI/Hn0uvmtA5DC1M2CPdxP55c5xvTSrEpJarA1p1tnZStTdtpGbQFHw yA+fek6a6/axaT/TUPwtpS/jSb8KyoeeiJV8pF8ao+oRAYIYfZfabBVtJKq67xkLR7zP V4zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-18127-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18127-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b73-20020a63344c000000b005ce0cf4a979si1591717pga.44.2024.01.05.09.40.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 09:40:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18127-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-18127-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18127-linux.lists.archive=gmail.com@vger.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CB477B224C1 for ; Fri, 5 Jan 2024 17:39:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 333C634571; Fri, 5 Jan 2024 17:39:30 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3773328AD; Fri, 5 Jan 2024 17:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-555144cd330so2313723a12.2; Fri, 05 Jan 2024 09:39:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704476365; x=1705081165; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RJ864dYz0Y/ieesbskVDxoJcEEeyC5EY2kKFTREupmw=; b=vv5XuswkR3iqdG+N1cvCw2j5vcA3HcOak4oSa4Y/5rIdCllm2xM1of5aLMvWsgNGpw JcfCFuUqUrKe9SLwWMfX3aG2UBkNLOVHEcv46BdCdSxv6pUeme3O0PXmYAAsQfY44ubS eXR8s67fguMBYAdeCW+fXdczgWwNmayKZV0lyS17zia1/8ZdflMsjd52aI/SGFDVD0pE lltakgRFhVcYRYsE3/iM+3zQnerOROQeFJaKNXHHYNZQnEtWvbK1XeeMTjcHSrVAG6Fq C1fDchM19YPebBjwMW9B/N55z/31W0yLCDD0tzn7aUKy8A+c7gTFqDXBt1zKvUklrr2D +PTg== X-Gm-Message-State: AOJu0YwK/qSlvdObNwrqKsEZqesAPaEjpcOv4ct0f/7ttx9fGZYOj19c 6U7VPWokmINwdyM2Wc36ZPQ= X-Received: by 2002:a50:9e06:0:b0:553:6b20:b707 with SMTP id z6-20020a509e06000000b005536b20b707mr1633983ede.15.1704476364965; Fri, 05 Jan 2024 09:39:24 -0800 (PST) Received: from localhost (fwdproxy-lla-007.fbsv.net. [2a03:2880:30ff:7::face:b00c]) by smtp.gmail.com with ESMTPSA id g1-20020a056402114100b0055534d5e75csm1186668edw.6.2024.01.05.09.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 09:39:24 -0800 (PST) From: Breno Leitao To: "David S. Miller" , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: leit@meta.com, netdev@vger.kernel.org (open list:NETWORKING [IPv4/IPv6]), linux-kernel@vger.kernel.org (open list), llvm@lists.linux.dev (open list:CLANG/LLVM BUILD SUPPORT:Keyword:\b(?i:clang|llvm)\b) Subject: [PATCH net-next] net/ipv6: resolve warning in ip6_fib.c Date: Fri, 5 Jan 2024 09:39:20 -0800 Message-Id: <20240105173920.1041474-1-leitao@debian.org> X-Mailer: git-send-email 2.39.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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; -- 2.39.3