]> git.ipfire.org Git - people/arne_f/kernel.git/commit
ipv4: ipconfig: avoid unused ic_proto_used symbol
authorArnd Bergmann <arnd@arndb.de>
Thu, 28 Jan 2016 16:39:24 +0000 (17:39 +0100)
committerSasha Levin <alexander.levin@microsoft.com>
Sun, 4 Mar 2018 15:28:30 +0000 (10:28 -0500)
commit33c5e9043ebd61a2b8b063c4f657f5739ef86519
tree8f1415a03c7cc4a01195e200840c5480a8401a7e
parent035c37bc7c06276661f71a0fcb175e7400c71938
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>
net/ipv4/ipconfig.c