Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: ipv4: ipconfig: fix unused variable

When CONFIG_PROC_FS isn't set, variable ipconfig_dir isn't used.
net/ipv4/ipconfig.c:167:31: warning: ‘ipconfig_dir’ defined but not used [-Wunused-variable]
static struct proc_dir_entry *ipconfig_dir;
^~~~~~~~~~~~
Move the declaration of ipconfig_dir inside the CONFIG_PROC_FS ifdef to
fix the warning.

Fixes: c04d2cb2009f ("ipconfig: Write NTP server IPs to /proc/net/ipconfig/ntp_servers")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Anders Roxell and committed by
David S. Miller
289e1f4e b2d6cee1

+2 -3
+2 -3
net/ipv4/ipconfig.c
··· 163 163 * Private state. 164 164 */ 165 165 166 - /* proc_dir_entry for /proc/net/ipconfig */ 167 - static struct proc_dir_entry *ipconfig_dir; 168 - 169 166 /* Name of user-selected boot device */ 170 167 static char user_dev_name[IFNAMSIZ] __initdata = { 0, }; 171 168 ··· 1289 1292 #endif /* IPCONFIG_DYNAMIC */ 1290 1293 1291 1294 #ifdef CONFIG_PROC_FS 1295 + /* proc_dir_entry for /proc/net/ipconfig */ 1296 + static struct proc_dir_entry *ipconfig_dir; 1292 1297 1293 1298 /* Name servers: */ 1294 1299 static int pnp_seq_show(struct seq_file *seq, void *v)