Skip to contentSkip to conversation

net: ipv4: avoid unused variable warning for sysctl

PATCH Applied Arnd Bergmann 3 participants 3 messages Feb 28, 2018 – Mar 1, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ipv4: avoid unused variable warning for sysctl

The newly introudced ip_min_valid_pmtu variable is only used when CONFIG_SYSCTL is set:

net/ipv4/route.c:135:12: error: 'ip_min_valid_pmtu' defined but not used [-Werror=unused-variable]

This moves it to the other variables like it, to avoid the harmless warning.

Fixes c7272c2f1229 ("net: ipv4: don't allow setting net.ipv4.route.min_pmtu below 68")
---
 net/ipv4/route.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv4/route.c +1 -2
index 5c85db355d1f..8d1f5c3a1745 100644
@@ -132,8 +132,6 @@ static int ip_rt_min_advmss __read_mostly	= 256;
 
 static int ip_rt_gc_timeout __read_mostly	= RT_GC_TIMEOUT;
 
-static int ip_min_valid_pmtu __read_mostly	= IPV4_MIN_MTU;
-
 /*
  *	Interface to generic destination cache.
  */
@@ -2805,6 +2803,7 @@ void ip_rt_multicast_event(struct in_device *in_dev)
 static int ip_rt_gc_interval __read_mostly  = 60 * HZ;
 static int ip_rt_gc_min_interval __read_mostly	= HZ / 2;
 static int ip_rt_gc_elasticity __read_mostly	= 8;
+static int ip_min_valid_pmtu __read_mostly	= IPV4_MIN_MTU;
 
 static int ipv4_sysctl_rtcache_flush(struct ctl_table *__ctl, int write,
 					void __user *buffer,
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

The newly introudced ip_min_valid_pmtu variable is only used when CONFIG_SYSCTL is set:

net/ipv4/route.c:135:12: error: 'ip_min_valid_pmtu' defined but not used [-Werror=unused-variable]

This moves it to the other variables like it, to avoid the harmless warning.

Fixes c7272c2f1229 ("net: ipv4: don't allow setting net.ipv4.route.min_pmtu below 68")

Crap. Thanks, and sorry for the mess.

Signature · 1 line
Sabrina
maintainer Applied
#2 lore raw
In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>
Date: Wed, 28 Feb 2018 14:32:48 +0100

Quoted 10 lines

The newly introudced ip_min_valid_pmtu variable is only used when CONFIG_SYSCTL is set:

net/ipv4/route.c:135:12: error: 'ip_min_valid_pmtu' defined but not used [-Werror=unused-variable]

This moves it to the other variables like it, to avoid the harmless warning.

Fixes c7272c2f1229 ("net: ipv4: don't allow setting net.ipv4.route.min_pmtu below 68")

Applied, thanks Arnd.