OSDN Git Service

netfilter: ipvs: avoid unused variable warnings
authorArnd Bergmann <arnd@arndb.de>
Wed, 27 Jan 2016 13:52:01 +0000 (14:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:03:47 +0000 (11:03 +0100)
commit88fb56455b1acd17cfd8d484e508fa4efe4794e7
tree8348fa85f562e25c94f278514f3ea8f1f51b4101
parentd4869f7f25a8441dbc004b67d1d55aa6520ce997
netfilter: ipvs: avoid unused variable warnings

commit f6ca9f46f6615c3a87529550058d1b468c0cad89 upstream.

The proc_create() and remove_proc_entry() functions do not reference
their arguments when CONFIG_PROC_FS is disabled, so we get a couple
of warnings about unused variables in IPVS:

ipvs/ip_vs_app.c:608:14: warning: unused variable 'net' [-Wunused-variable]
ipvs/ip_vs_ctl.c:3950:14: warning: unused variable 'net' [-Wunused-variable]
ipvs/ip_vs_ctl.c:3994:14: warning: unused variable 'net' [-Wunused-variable]

This removes the local variables and instead looks them up separately
for each use, which obviously avoids the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 4c50a8ce2b63 ("netfilter: ipvs: avoid unused variable warning")
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/ipvs/ip_vs_app.c
net/netfilter/ipvs/ip_vs_ctl.c