summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-01-28 17:39:24 +0100
committerSasha Levin <alexander.levin@microsoft.com>2018-03-04 10:28:30 -0500
commit33c5e9043ebd61a2b8b063c4f657f5739ef86519 (patch)
tree8f1415a03c7cc4a01195e200840c5480a8401a7e /net
parent035c37bc7c06276661f71a0fcb175e7400c71938 (diff)
downloadlinux-33c5e9043ebd61a2b8b063c4f657f5739ef86519.tar.gz
linux-33c5e9043ebd61a2b8b063c4f657f5739ef86519.tar.bz2
linux-33c5e9043ebd61a2b8b063c4f657f5739ef86519.zip
ipv4: ipconfig: avoid unused ic_proto_used symbol
[ Upstream commit 52b79e2bdf92b07b37c805c50811eaf69a33683d ] When CONFIG_PROC_FS, CONFIG_IP_PNP_BOOTP, CONFIG_IP_PNP_DHCP and CONFIG_IP_PNP_RARP are all disabled, we get a warning about the ic_proto_used variable being unused: net/ipv4/ipconfig.c:146:12: error: 'ic_proto_used' defined but not used [-Werror=unused-variable] This avoids the warning, by making the definition conditional on whether a dynamic IP configuration protocol is configured. If not, we know that the value is always zero, so we can optimize away the variable and all code that depends on it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/ipconfig.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 8e7328c6a390..6389616ccc3f 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -148,7 +148,11 @@ static char vendor_class_identifier[253] __initdata;
/* Persistent data: */
+#ifdef IPCONFIG_DYNAMIC
static int ic_proto_used; /* Protocol used, if any */
+#else
+#define ic_proto_used 0
+#endif
static __be32 ic_nameservers[CONF_NAMESERVERS_MAX]; /* DNS Server IP addresses */
static u8 ic_domain[64]; /* DNS (not NIS) domain name */