Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1119179lqp; Fri, 22 Mar 2024 06:18:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUC/i4ah+7bgMkhhfHNMsiBT88nGMYYNXNZmQhSNhn/OA0C0FmiH5fZUPcKPvwavTkFNQzwm6y1BEMFwJ7xG2eXYhvEKJs4SsYtp/jgiw== X-Google-Smtp-Source: AGHT+IFQtB4zw20KAVVJ7Z+Ojd7SD4Vpx2gMUDhyyF0yudom5U8upbmhI4pQJMF092pM+o08NVpl X-Received: by 2002:a50:d78d:0:b0:568:b0f4:fe69 with SMTP id w13-20020a50d78d000000b00568b0f4fe69mr1598399edi.12.1711113482813; Fri, 22 Mar 2024 06:18:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711113482; cv=pass; d=google.com; s=arc-20160816; b=gXCoaxpJGeSSAoiX7eRJKOyyTLeRU5xz3R6VpC7CQlvJguwLA0XGWK9e3+ohxMgrAK dYs7SKKYCmZEBX5oxsAcrDaVZ58Qjj4ufNB2okJYdunJAZaZXwpjU4vy+QtTof4jMXre dbmBD5Hwo2d99qiYGGl11K82AbsgeZB7KbIGUE33TA2p/xtK6aC60EoUmafeV5RijYdc Z+ffccCel+RcYOXPURw/mhJMBP5cxBZ4P7FeaSTOtzuIA0EPOMYXCg6EKojKPiqtujp6 4si1m6jrmozls+E0TbRLpenmawZK31ZLFaDyisrrdeQ8D6d5HzuLz4v+PA1EeDFztCZr lFDA== ARC-Message-Signature: i=2; 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:dkim-signature; bh=Ge2kPDDdGfSi1LNdgjcnxywRPM7YYk9j8ZciLI37U1c=; fh=3CnoIolx6vSiesjBnRWDwoCi+F8PqAA+NU0Is4BZmbs=; b=Fh6dOiXYt+sBl79aYCji15GmBHHE5u2nFsbRquPx/wk8dB6agq5VpljDvIzi+JlSVH sCyRcc1bYNeVwLt/4LxJMHX7l+O/Gu7pfjKFaXezP255Y6YEUKwaZ4+g9S4fpxcfRAK0 dOH8x+y5uo0QvW543H0CU246SY+zCsTQVN9W9yAPm2VE9+gMOv8PWhJN2GNOYjhMcjHv lW5+pZqAHXx8HrmD9Z3VzUvHir/rjP1HunE76w+fdgX8o39vu0wqYdDkiIE52VWQjpm3 U9mWtzo28VxYJw5ob9nXcSRyiW/pQlcKYwbsqLZpWNdsc6W/pkmwwofirgLdY5JmGCG8 fkeg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b8uGsZVG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111457-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111457-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c39-20020a509faa000000b0056889ee41c1si943111edf.356.2024.03.22.06.18.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 06:18:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111457-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b8uGsZVG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111457-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111457-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 89E0E1F22CB5 for ; Fri, 22 Mar 2024 13:18:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16BF645BFD; Fri, 22 Mar 2024 13:17:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b8uGsZVG" 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 350783F9FD; Fri, 22 Mar 2024 13:17:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711113473; cv=none; b=bE/bzjYSSIsQ8DJQXxJyu5uqxRNkrgj0FBAuNZ80ZI4EXv9YiMIdZLbo21IuUPl6jJh2gVGxFzquaaGXrpPvtWA3hHx20BjgMWoMfTBpO8BniFpmuE9VWMd0M9xkkN5zKh9uHaT/gRCBlXPfZENnHObdNFIm7SHPKJkA/UULsgY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711113473; c=relaxed/simple; bh=x8FKlYxdpZPEJEcYc42RZj3Ld0nf+hduPeef1yCM4KU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=poUf1C9+/h35gdiY3n3IP4Quq2cAajxrm2E7Xzwmh3iymSOy1q0DsSuM3n2T66vT7yTRT5BKcw73Lcd1R/h9rnGg1niEUBQbKv2AnqoRHfIJFeq4l69buR8Fv3Eitey2WNR65tqY3iWSnfS0/JFLCCv/YiautH7NRMO4aiLKcaY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b8uGsZVG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5A77C433C7; Fri, 22 Mar 2024 13:17:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711113472; bh=x8FKlYxdpZPEJEcYc42RZj3Ld0nf+hduPeef1yCM4KU=; h=From:To:Cc:Subject:Date:From; b=b8uGsZVGj3oXY28nV8Jb6LRkI5oCnOJNKT/a2CGD2mW3FZ62N9JQD8oiVaiUMA2YP +SyE4ZAeXyrrlfCZ3kgMdi5bVn0aVSsSP4VKKWWhR3DrTZY2djNcfggMQm/akMGW+U k1jMY5/9LDO7nZVHRPmsPw0kTESEWtmXR09B5RRQPQdOaXXpUJHJJqfSVd5Vzr/xJS wqb7KRrQjmqNgASJfEmmf16+96LMkfwpXdLkdVrc2i5Nxy80OwQ/x6cmf0xwt42q8T JqvAFxlSxtOftdpCUh7kSfGRas6EIu4VDO1dfS9EuLSDefTHx6Ob19eoFtO+YB7Psg GzIevVXEdVyrg== From: Arnd Bergmann To: "David S. Miller" , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni , YOSHIFUJI Hideaki , Ville Nuorvala Cc: Arnd Bergmann , Kui-Feng Lee , Breno Leitao , Kunwu Chan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ipv6: fib: hide unused 'pn' variable Date: Fri, 22 Mar 2024 14:14:10 +0100 Message-Id: <20240322131746.904943-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann When CONFIG_IPV6_SUBTREES is disabled, the only user is hidden, causing a 'make W=1' warning: net/ipv6/ip6_fib.c: In function 'fib6_add': net/ipv6/ip6_fib.c:1388:32: error: variable 'pn' set but not used [-Werror=unused-but-set-variable] Add another #ifdef around the variable declaration, matching the other uses in this file. Fixes: 66729e18df08 ("[IPV6] ROUTE: Make sure we have fn->leaf when adding a node on subtree.") Signed-off-by: Arnd Bergmann --- net/ipv6/ip6_fib.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 5c558dc1c683..a2888bda3a87 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -1385,7 +1385,10 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt, struct nl_info *info, struct netlink_ext_ack *extack) { struct fib6_table *table = rt->fib6_table; - struct fib6_node *fn, *pn = NULL; + struct fib6_node *fn; +#ifdef CONFIG_IPV6_SUBTREES + struct fib6_node *pn = NULL; +#endif int err = -ENOMEM; int allow_create = 1; int replace_required = 0; @@ -1409,9 +1412,9 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt, goto out; } +#ifdef CONFIG_IPV6_SUBTREES pn = fn; -#ifdef CONFIG_IPV6_SUBTREES if (rt->fib6_src.plen) { struct fib6_node *sn; -- 2.39.2