[lkml]   [2018]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.4 118/193] ipv4: ipconfig: avoid unused ic_proto_used symbol
4.4-stable review patch.  If anyone has any objections, please let me know.


From: Arnd Bergmann <>

commit 52b79e2bdf92b07b37c805c50811eaf69a33683d upstream.

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 <>
Signed-off-by: David S. Miller <>
Signed-off-by: Greg Kroah-Hartman <>

net/ipv4/ipconfig.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -152,7 +152,11 @@ static char dhcp_client_identifier[253]

/* Persistent data: */

static int ic_proto_used; /* Protocol used, if any */
+#define ic_proto_used 0
static __be32 ic_nameservers[CONF_NAMESERVERS_MAX]; /* DNS Server IP addresses */
static u8 ic_domain[64]; /* DNS (not NIS) domain name */

 \ /
  Last update: 2018-02-23 21:19    [W:0.415 / U:3.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site