ipv6: ioam: fix unused function warning
Subsystems (3)
PATCH 1/1 ipv6: ioam: fix unused function warning
From: Arnd Bergmann <[email protected]>
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 <[email protected]>
--- net/ipv6/addrconf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/addrconf.c +2 -2
@@ -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" ,
Signature · 1 line
2.29.2