diff mbox series

ipv6: ioam: fix unused function warning

Message ID 20210723091556.1740686-1-arnd@kernel.org
State New
Headers show
Series ipv6: ioam: fix unused function warning | expand

Commit Message

Arnd Bergmann July 23, 2021, 9:15 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de>


ioam6_if_id_max is defined globally but used only when
CONFIG_SYSCTL is enabled:

net/ipv6/addrconf.c:99:12: error: 'ioam6_if_id_max' defined but not used [-Werror=unused-variable]

Move the variable definition closer to the usage inside of the
same #ifdef.

Fixes: 9ee11f0fff20 ("ipv6: ioam: Data plane support for Pre-allocated Trace")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 net/ipv6/addrconf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.29.2
diff mbox series

Patch

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 1802287977f1..cd3171749622 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -96,8 +96,6 @@ 
 #define IPV6_MAX_STRLEN \
 	sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
 
-static u32 ioam6_if_id_max = U16_MAX;
-
 static inline u32 cstamp_delta(unsigned long cstamp)
 {
 	return (cstamp - INITIAL_JIFFIES) * 100UL / HZ;
@@ -6551,6 +6549,8 @@  static int addrconf_sysctl_disable_policy(struct ctl_table *ctl, int write,
 static int minus_one = -1;
 static const int two_five_five = 255;
 
+static u32 ioam6_if_id_max = U16_MAX;
+
 static const struct ctl_table addrconf_sysctl[] = {
 	{
 		.procname	= "forwarding",