netfilter: ipt_CLUSTERIP: fix warning unused variable cn
Subsystems (3)
PATCH 1/1 netfilter: ipt_CLUSTERIP: fix warning unused variable cn
When CONFIG_PROC_FS isn't set the variable cn isn't used.
net/ipv4/netfilter/ipt_CLUSTERIP.c: In function ‘clusterip_net_exit’:net/ipv4/netfilter/ipt_CLUSTERIP.c:849:24: warning: unused variable ‘cn’ [-Wunused-variable]
struct clusterip_net *cn = clusterip_pernet(net);
^~Rework so the variable 'cn' is declared inside "#ifdef CONFIG_PROC_FS".
Fixes b12f7bad5ad3 ("netfilter: ipt_CLUSTERIP: remove wrong WARN_ON_ONCE in netns exit routine")
Signed-off-by Anders Roxell <[email protected]>
--- net/ipv4/netfilter/ipt_CLUSTERIP.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/netfilter/ipt_CLUSTERIP.c +1 -1
@@ -846,9 +846,9 @@ static int clusterip_net_init(struct net *net)static void clusterip_net_exit (struct net *net) { +#ifdef CONFIG_PROC_FS struct clusterip_net *cn =clusterip_pernet (net); -#ifdef CONFIG_PROC_FS mutex_lock (&cn->mutex);proc_remove (cn->procdir); cn->procdir =NULL ;
Signature · 1 line
2.19.2
Quoted 8 lines · Anders Roxell
When
CONFIG_PROC_FSisn't set the variable cn isn't used.
net/ipv4/netfilter/ipt_CLUSTERIP.c: In function ‘clusterip_net_exit’:net/ipv4/netfilter/ipt_CLUSTERIP.c:849:24: warning: unused variable ‘cn’ [-Wunused-variable]struct clusterip_net *cn = clusterip_pernet(net); ^~Rework so the variable 'cn' is declared inside "#ifdef
CONFIG_PROC_FS".
Applied, thanks.