Skip to content

Commit e9f4cfe

Browse files
arndbgregkh
authored andcommitted
ipv6: fib: hide unused 'pn' variable
[ Upstream commit 7404348 ] 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: 66729e1 ("[IPV6] ROUTE: Make sure we have fn->leaf when adding a node on subtree.") Link: https://lore.kernel.org/netdev/[email protected]/ Reviewed-by: David Ahern <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d3adf11 commit e9f4cfe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

net/ipv6/ip6_fib.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,10 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
13071307
struct nl_info *info, struct netlink_ext_ack *extack)
13081308
{
13091309
struct fib6_table *table = rt->fib6_table;
1310-
struct fib6_node *fn, *pn = NULL;
1310+
struct fib6_node *fn;
1311+
#ifdef CONFIG_IPV6_SUBTREES
1312+
struct fib6_node *pn = NULL;
1313+
#endif
13111314
int err = -ENOMEM;
13121315
int allow_create = 1;
13131316
int replace_required = 0;
@@ -1331,9 +1334,9 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
13311334
goto out;
13321335
}
13331336

1337+
#ifdef CONFIG_IPV6_SUBTREES
13341338
pn = fn;
13351339

1336-
#ifdef CONFIG_IPV6_SUBTREES
13371340
if (rt->fib6_src.plen) {
13381341
struct fib6_node *sn;
13391342

0 commit comments

Comments
 (0)