Skip to content

Commit

Permalink
net: ipv4: ipconfig: fix unused variable
Browse files Browse the repository at this point in the history
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: c04d2cb ("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>
  • Loading branch information
Anders Roxell authored and David S. Miller committed May 14, 2018
1 parent b2d6cee commit 289e1f4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/ipv4/ipconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ static u8 ic_domain[64]; /* DNS (not NIS) domain name */
* Private state.
*/

/* proc_dir_entry for /proc/net/ipconfig */
static struct proc_dir_entry *ipconfig_dir;

/* Name of user-selected boot device */
static char user_dev_name[IFNAMSIZ] __initdata = { 0, };

Expand Down Expand Up @@ -1292,6 +1289,8 @@ static int __init ic_dynamic(void)
#endif /* IPCONFIG_DYNAMIC */

#ifdef CONFIG_PROC_FS
/* proc_dir_entry for /proc/net/ipconfig */
static struct proc_dir_entry *ipconfig_dir;

/* Name servers: */
static int pnp_seq_show(struct seq_file *seq, void *v)
Expand Down

0 comments on commit 289e1f4

Please sign in to comment.