Skip to contentSkip to conversation

netfilter: ipvs: avoid unused variable warning

PATCH Applied Arnd Bergmann 3 participants 3 messages Nov 30, 2015 – Dec 1, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: ipvs: avoid unused variable warning

When CONFIG_PROC_FS is disabled, the local 'net' variable in ip_vs_app_net_init becomes unused, as gcc warns:

net/netfilter/ipvs/ip_vs_app.c: In function 'ip_vs_app_net_init':
net/netfilter/ipvs/ip_vs_app.c:608:14: warning: unused variable 'net' [-Wunused-variable]

This removes the line by moving the pointer dereference into the user of the variable.

net/netfilter/ipvs/ip_vs_app.c +0 -1
index 0328f7250693..e5422d3db501 100644
@@ -614,8 +614,6 @@ int __net_init ip_vs_app_net_init(struct netns_ipvs *ipvs)
 
 void __net_exit ip_vs_app_net_cleanup(struct netns_ipvs *ipvs)
 {
-	struct net *net = ipvs->net;
maintainer Acked-by on v1 1/1
#1 lore raw

Hello,

Quoted 10 lines · Arnd Bergmann

When CONFIG_PROC_FS is disabled, the local 'net' variable in ip_vs_app_net_init becomes unused, as gcc warns:

net/netfilter/ipvs/ip_vs_app.c: In function 'ip_vs_app_net_init':
net/netfilter/ipvs/ip_vs_app.c:608:14: warning: unused variable 'net' [-Wunused-variable]

This removes the line by moving the pointer dereference into the user of the variable.

Quoted 5 lines
net/netfilter/ipvs/ip_vs_app.c +0 -0
index 0328f7250693..e5422d3db501 100644

net/netfilter/ipvs/ip_vs_app.c int __net_init ip_vs_app_net_init(struct netns_ipvs *ipvs) · line 619

Quoted 9 lines
net/netfilter/ipvs/ip_vs_app.c +1 -3
@@ -614,8 +614,6 @@ int __net_init ip_vs_app_net_init(struct netns_ipvs *ipvs)
 
 void __net_exit ip_vs_app_net_cleanup(struct netns_ipvs *ipvs)
 {
-	struct net *net = ipvs->net;
-
 	unregister_ip_vs_app(ipvs, NULL /* all */);
-	remove_proc_entry("ip_vs_app", net->proc_net);
+	remove_proc_entry("ip_vs_app", ipvs->net->proc_net);
 }

Regards

--
Julian Anastasov <[email protected]>

maintainer Applied
#2 lore raw
Quoted 11 lines · Julian Anastasov

Hello,

Quoted 6 lines · Arnd Bergmann

When CONFIG_PROC_FS is disabled, the local 'net' variable in ip_vs_app_net_init becomes unused, as gcc warns:

net/netfilter/ipvs/ip_vs_app.c: In function 'ip_vs_app_net_init':
net/netfilter/ipvs/ip_vs_app.c:608:14: warning: unused variable 'net' [-Wunused-variable]

Quoted 6 lines
Quoted 4 lines

This removes the line by moving the pointer dereference into the user of the variable.

Thanks, applied to ipvs-next.