* [PATCH] netfilter: ipvs: avoid unused variable warning
@ 2015-11-30 9:54 Arnd Bergmann
2015-11-30 20:48 ` Julian Anastasov
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2015-11-30 9:54 UTC (permalink / raw)
To: Wensong Zhang, Simon Horman, lvs-devel
Cc: Julian Anastasov, Pablo Neira Ayuso, Patrick McHardy,
Jozsef Kadlecsik, David S. Miller, netdev, netfilter-devel,
coreteam
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.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
index 0328f7250693..e5422d3db501 100644
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] netfilter: ipvs: avoid unused variable warning
2015-11-30 9:54 [PATCH] netfilter: ipvs: avoid unused variable warning Arnd Bergmann
@ 2015-11-30 20:48 ` Julian Anastasov
2015-12-01 7:48 ` Simon Horman
0 siblings, 1 reply; 3+ messages in thread
From: Julian Anastasov @ 2015-11-30 20:48 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Wensong Zhang, Simon Horman, lvs-devel, Pablo Neira Ayuso,
Patrick McHardy, Jozsef Kadlecsik, David S. Miller, netdev,
netfilter-devel, coreteam
Hello,
On Mon, 30 Nov 2015, Arnd Bergmann wrote:
> 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.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Julian Anastasov <ja@ssi.bg>
> diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
> index 0328f7250693..e5422d3db501 100644
> --- a/net/netfilter/ipvs/ip_vs_app.c
> +++ b/net/netfilter/ipvs/ip_vs_app.c
> @@ -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 <ja@ssi.bg>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] netfilter: ipvs: avoid unused variable warning
2015-11-30 20:48 ` Julian Anastasov
@ 2015-12-01 7:48 ` Simon Horman
0 siblings, 0 replies; 3+ messages in thread
From: Simon Horman @ 2015-12-01 7:48 UTC (permalink / raw)
To: Julian Anastasov
Cc: Arnd Bergmann, Wensong Zhang, lvs-devel, Pablo Neira Ayuso,
Patrick McHardy, Jozsef Kadlecsik, David S. Miller, netdev,
netfilter-devel, coreteam
On Mon, Nov 30, 2015 at 10:48:34PM +0200, Julian Anastasov wrote:
>
> Hello,
>
> On Mon, 30 Nov 2015, Arnd Bergmann wrote:
>
> > 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.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Acked-by: Julian Anastasov <ja@ssi.bg>
Thanks, applied to ipvs-next.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-12-01 7:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-30 9:54 [PATCH] netfilter: ipvs: avoid unused variable warning Arnd Bergmann
2015-11-30 20:48 ` Julian Anastasov
2015-12-01 7:48 ` 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).