* [PATCH] ipvs: Remove possibly unused variables from ip_vs_conn_net_{init,cleanup}
@ 2015-10-06 8:14 Simon Horman
0 siblings, 0 replies; only message in thread
From: Simon Horman @ 2015-10-06 8:14 UTC (permalink / raw)
To: lvs-devel
Cc: netdev, netfilter-devel, Wensong Zhang, Julian Anastasov,
Eric W. Biederman, Simon Horman
If CONFIG_PROC_FS is undefined then the arguments of proc_create()
and remove_proc_entry() are unused. As a result the net variables of
ip_vs_conn_net_{init,cleanup} are unused.
Resolve this by dereferencing net as needed rather than storing it
in a variable.
Fixes: 3d99376689ee ("ipvs: Pass ipvs not net into ip_vs_control_net_(init|cleanup)")
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_conn.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index d1d168c7fc68..85ca189bdc3d 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -1347,23 +1347,20 @@ flush_again:
*/
int __net_init ip_vs_conn_net_init(struct netns_ipvs *ipvs)
{
- struct net *net = ipvs->net;
-
atomic_set(&ipvs->conn_count, 0);
- proc_create("ip_vs_conn", 0, net->proc_net, &ip_vs_conn_fops);
- proc_create("ip_vs_conn_sync", 0, net->proc_net, &ip_vs_conn_sync_fops);
+ proc_create("ip_vs_conn", 0, ipvs->net->proc_net, &ip_vs_conn_fops);
+ proc_create("ip_vs_conn_sync", 0, ipvs->net->proc_net,
+ &ip_vs_conn_sync_fops);
return 0;
}
void __net_exit ip_vs_conn_net_cleanup(struct netns_ipvs *ipvs)
{
- struct net *net = ipvs->net;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-10-06 8:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06 8:14 [PATCH] ipvs: Remove possibly unused variables from ip_vs_conn_net_{init,cleanup} Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).