Skip to content

Commit 082c7ca

Browse files
Gao fengdavem330
authored andcommitted
net: ipv4: fix waring -Wunused-variable
the vars ip_rt_gc_timeout is used only when CONFIG_SYSCTL is selected. move these vars into CONFIG_SYSCTL. Signed-off-by: Gao feng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4fc1a60 commit 082c7ca

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

net/ipv4/route.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,11 @@
117117
#define RT_GC_TIMEOUT (300*HZ)
118118

119119
static int ip_rt_max_size;
120-
static int ip_rt_gc_timeout __read_mostly = RT_GC_TIMEOUT;
121-
static int ip_rt_gc_interval __read_mostly = 60 * HZ;
122-
static int ip_rt_gc_min_interval __read_mostly = HZ / 2;
123120
static int ip_rt_redirect_number __read_mostly = 9;
124121
static int ip_rt_redirect_load __read_mostly = HZ / 50;
125122
static int ip_rt_redirect_silence __read_mostly = ((HZ / 50) << (9 + 1));
126123
static int ip_rt_error_cost __read_mostly = HZ;
127124
static int ip_rt_error_burst __read_mostly = 5 * HZ;
128-
static int ip_rt_gc_elasticity __read_mostly = 8;
129125
static int ip_rt_mtu_expires __read_mostly = 10 * 60 * HZ;
130126
static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20;
131127
static int ip_rt_min_advmss __read_mostly = 256;
@@ -2423,6 +2419,11 @@ void ip_rt_multicast_event(struct in_device *in_dev)
24232419
}
24242420

24252421
#ifdef CONFIG_SYSCTL
2422+
static int ip_rt_gc_timeout __read_mostly = RT_GC_TIMEOUT;
2423+
static int ip_rt_gc_interval __read_mostly = 60 * HZ;
2424+
static int ip_rt_gc_min_interval __read_mostly = HZ / 2;
2425+
static int ip_rt_gc_elasticity __read_mostly = 8;
2426+
24262427
static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write,
24272428
void __user *buffer,
24282429
size_t *lenp, loff_t *ppos)

0 commit comments

Comments
 (0)