All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2] net: Fix unused variable compile warning
@ 2015-10-01 15:49 David Ahern
  2015-10-05 17:53 ` Cong Wang
  0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2015-10-01 15:49 UTC (permalink / raw)
  To: netdev; +Cc: dsahern, David Ahern

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>
---
v2
- removed unrelated change from other work

 net/netfilter/ipvs/ip_vs_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 37dd77a3d0fb..9897e6272015 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1174,7 +1174,6 @@ handle_response(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
 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;
@@ -1274,7 +1273,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,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] net: Fix unused variable compile warning
  2015-10-01 15:49 [PATCH net-next v2] net: Fix unused variable compile warning David Ahern
@ 2015-10-05 17:53 ` Cong Wang
  2015-10-06  6:35   ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Cong Wang @ 2015-10-05 17:53 UTC (permalink / raw)
  To: David Ahern; +Cc: netdev, David Ahern, David Miller

On Thu, Oct 1, 2015 at 8:49 AM, David Ahern <dsa@cumulusnetworks.com> wrote:
> 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>

I saw the same build warning, and this fix looks good to me.

DaveM, can you take this?

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] net: Fix unused variable compile warning
  2015-10-05 17:53 ` Cong Wang
@ 2015-10-06  6:35   ` David Miller
  2015-10-07  1:02     ` Simon Horman
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2015-10-06  6:35 UTC (permalink / raw)
  To: cwang; +Cc: dsa, netdev, dsahern

From: Cong Wang <cwang@twopensource.com>
Date: Mon, 5 Oct 2015 10:53:57 -0700

> On Thu, Oct 1, 2015 at 8:49 AM, David Ahern <dsa@cumulusnetworks.com> wrote:
>> 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>
> 
> I saw the same build warning, and this fix looks good to me.
> 
> DaveM, can you take this?

It should be submitted to netfilter-devel and Pablo should take it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] net: Fix unused variable compile warning
  2015-10-06  6:35   ` David Miller
@ 2015-10-07  1:02     ` Simon Horman
  2015-10-07  2:19       ` David Ahern
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Horman @ 2015-10-07  1:02 UTC (permalink / raw)
  To: David Miller; +Cc: cwang, dsa, netdev, dsahern

On Mon, Oct 05, 2015 at 11:35:37PM -0700, David Miller wrote:
> From: Cong Wang <cwang@twopensource.com>
> Date: Mon, 5 Oct 2015 10:53:57 -0700
> 
> > On Thu, Oct 1, 2015 at 8:49 AM, David Ahern <dsa@cumulusnetworks.com> wrote:
> >> 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>
> > 
> > I saw the same build warning, and this fix looks good to me.
> > 
> > DaveM, can you take this?
> 
> It should be submitted to netfilter-devel and Pablo should take it.

lvs-devel would be better yet.
I submitted an identical patch there yesterday.

I'll pick up David's version and send it to Pablo ASAP.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] net: Fix unused variable compile warning
  2015-10-07  1:02     ` Simon Horman
@ 2015-10-07  2:19       ` David Ahern
  0 siblings, 0 replies; 5+ messages in thread
From: David Ahern @ 2015-10-07  2:19 UTC (permalink / raw)
  To: Simon Horman, David Miller; +Cc: cwang, dsa, netdev, dsahern

On 10/6/15 7:02 PM, Simon Horman wrote:
> lvs-devel would be better yet.
> I submitted an identical patch there yesterday.
>
> I'll pick up David's version and send it to Pablo ASAP.

Thanks, Simon. I need to remember to consult the MAINTAINERS file.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-07  2:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-01 15:49 [PATCH net-next v2] net: Fix unused variable compile warning David Ahern
2015-10-05 17:53 ` Cong Wang
2015-10-06  6:35   ` David Miller
2015-10-07  1:02     ` Simon Horman
2015-10-07  2:19       ` David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.