Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] ipv6: ioam: fix unused function warning
@ 2021-07-23  9:15 Arnd Bergmann
  0 siblings, 0 replies; only message in thread
From: Arnd Bergmann @ 2021-07-23  9:15 UTC (permalink / raw)
  To: David S. Miller, Hideaki YOSHIFUJI, David Ahern, Jakub Kicinski,
	Justin Iurman
  Cc: Arnd Bergmann, Xin Long, Matteo Croce, Florent Fourcot,
	Taehee Yoo, Rocco Yue, Stephen Hemminger, Praveen Chaudhary,
	netdev, linux-kernel

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(-)

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",
-- 
2.29.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-23  9:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-23  9:15 [PATCH] ipv6: ioam: fix unused function warning Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).