Skip to content

Commit c31205e

Browse files
arndbsmb49
authored andcommitted
ipv6: fib: hide unused 'pn' variable
BugLink: https://bugs.launchpad.net/bugs/2065857 [ 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]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Roxana Nicolescu <[email protected]>
1 parent d178cb1 commit c31205e

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
@@ -1375,7 +1375,10 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
13751375
struct nl_info *info, struct netlink_ext_ack *extack)
13761376
{
13771377
struct fib6_table *table = rt->fib6_table;
1378-
struct fib6_node *fn, *pn = NULL;
1378+
struct fib6_node *fn;
1379+
#ifdef CONFIG_IPV6_SUBTREES
1380+
struct fib6_node *pn = NULL;
1381+
#endif
13791382
int err = -ENOMEM;
13801383
int allow_create = 1;
13811384
int replace_required = 0;
@@ -1399,9 +1402,9 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
13991402
goto out;
14001403
}
14011404

1405+
#ifdef CONFIG_IPV6_SUBTREES
14021406
pn = fn;
14031407

1404-
#ifdef CONFIG_IPV6_SUBTREES
14051408
if (rt->fib6_src.plen) {
14061409
struct fib6_node *sn;
14071410

0 commit comments

Comments
 (0)