diff mbox

[nf-next,1/2] ipvs: Remove possibly unused variable from ip_vs_out

Message ID 1444195403-4288-2-git-send-email-horms@verge.net.au
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Simon Horman Oct. 7, 2015, 5:23 a.m. UTC
From: David Ahern <dsa@cumulusnetworks.com>

Eric's net namespace changes in 1b75097dd7a26 leaves net unreferenced if
CONFIG_IP_VS_IPV6 is not enabled:

../net/netfilter/ipvs/ip_vs_core.c: In function ‘ip_vs_out’:
../net/netfilter/ipvs/ip_vs_core.c:1177:14: warning: unused variable ‘net’ [-Wunused-variable]

After the net refactoring there is only 1 user; push the reference to the
1 user. While the line length slightly exceeds 80 it seems to be the
best change.

Fixes: 1b75097dd7a26("ipvs: Pass ipvs into ip_vs_out")
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
[horms: updated subject]
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Sergei Shtylyov Oct. 7, 2015, 1:58 p.m. UTC | #1
Hello.

On 10/7/2015 8:23 AM, Simon Horman wrote:

> From: David Ahern <dsa@cumulusnetworks.com>
>
> Eric's net namespace changes in 1b75097dd7a26 leaves net unreferenced if
> CONFIG_IP_VS_IPV6 is not enabled:
>
> ../net/netfilter/ipvs/ip_vs_core.c: In function ‘ip_vs_out’:
> ../net/netfilter/ipvs/ip_vs_core.c:1177:14: warning: unused variable ‘net’ [-Wunused-variable]
>
> After the net refactoring there is only 1 user; push the reference to the
> 1 user. While the line length slightly exceeds 80 it seems to be the
> best change.
>
> Fixes: 1b75097dd7a26("ipvs: Pass ipvs into ip_vs_out")

    Minor nit: missing space before (. Could be probbably fixed while applying...

> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
> Acked-by: Julian Anastasov <ja@ssi.bg>
> [horms: updated subject]
> Signed-off-by: Simon Horman <horms@verge.net.au>

[...]

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
John D Allen, Leveridge Systems INC Oct. 7, 2015, 2:33 p.m. UTC | #2
Kernel level, OSI layers 2-3 Network driver developments, anyone in Northwest US ?

thanks, John.

> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pablo Neira Ayuso Oct. 12, 2015, 3:43 p.m. UTC | #3
On Wed, Oct 07, 2015 at 04:58:47PM +0300, Sergei Shtylyov wrote:
> Hello.
> 
> On 10/7/2015 8:23 AM, Simon Horman wrote:
> 
> >From: David Ahern <dsa@cumulusnetworks.com>
> >
> >Eric's net namespace changes in 1b75097dd7a26 leaves net unreferenced if
> >CONFIG_IP_VS_IPV6 is not enabled:
> >
> >../net/netfilter/ipvs/ip_vs_core.c: In function ‘ip_vs_out’:
> >../net/netfilter/ipvs/ip_vs_core.c:1177:14: warning: unused variable ‘net’ [-Wunused-variable]
> >
> >After the net refactoring there is only 1 user; push the reference to the
> >1 user. While the line length slightly exceeds 80 it seems to be the
> >best change.
> >
> >Fixes: 1b75097dd7a26("ipvs: Pass ipvs into ip_vs_out")
> 
>    Minor nit: missing space before (. Could be probbably fixed while applying...

I have pulled this anyway, I don't want to keep this back for this
minor style problem.

But please Simon, run checkpatch.pl before submitting next time.

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Oct. 14, 2015, 2:10 a.m. UTC | #4
On Mon, Oct 12, 2015 at 05:43:49PM +0200, Pablo Neira Ayuso wrote:
> On Wed, Oct 07, 2015 at 04:58:47PM +0300, Sergei Shtylyov wrote:
> > Hello.
> > 
> > On 10/7/2015 8:23 AM, Simon Horman wrote:
> > 
> > >From: David Ahern <dsa@cumulusnetworks.com>
> > >
> > >Eric's net namespace changes in 1b75097dd7a26 leaves net unreferenced if
> > >CONFIG_IP_VS_IPV6 is not enabled:
> > >
> > >../net/netfilter/ipvs/ip_vs_core.c: In function ‘ip_vs_out’:
> > >../net/netfilter/ipvs/ip_vs_core.c:1177:14: warning: unused variable ‘net’ [-Wunused-variable]
> > >
> > >After the net refactoring there is only 1 user; push the reference to the
> > >1 user. While the line length slightly exceeds 80 it seems to be the
> > >best change.
> > >
> > >Fixes: 1b75097dd7a26("ipvs: Pass ipvs into ip_vs_out")
> > 
> >    Minor nit: missing space before (. Could be probbably fixed while applying...
> 
> I have pulled this anyway, I don't want to keep this back for this
> minor style problem.
> 
> But please Simon, run checkpatch.pl before submitting next time.

Sorry about that, I will try to be more careful.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index d08df435c2aa..3773154d9b71 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1172,7 +1172,6 @@  drop:
 static unsigned int
 ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, int af)
 {
-	struct net *net = ipvs->net;
 	struct ip_vs_iphdr iph;
 	struct ip_vs_protocol *pp;
 	struct ip_vs_proto_data *pd;
@@ -1272,7 +1271,7 @@  ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, in
 #ifdef CONFIG_IP_VS_IPV6
 				if (af == AF_INET6) {
 					if (!skb->dev)
-						skb->dev = net->loopback_dev;
+						skb->dev = ipvs->net->loopback_dev;
 					icmpv6_send(skb,
 						    ICMPV6_DEST_UNREACH,
 						    ICMPV6_PORT_UNREACH,