[PATCH] ipvs: Remove unused net variable from ip_vs_out

Subsystems: ipvs, netfilter, networking [general], the rest

STALE3990d

4 messages, 3 authors, 2015-10-06 · open the first message on its own page

[PATCH] ipvs: Remove unused net variable from ip_vs_out

From: Simon Horman <horms@verge.net.au>
Date: 2015-10-02 00:43:39

Since 6f2bcea9917d ("ipvs: Pass ipvs into ip_vs_in_icmp and ip_vs_in_icmp_v6")
the net net variable in ip_vs_out() appears to be unused so remove it.

Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_core.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index d08df435c2aa..72b6a44ea9de 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;
-- 
2.1.4

Re: [PATCH] ipvs: Remove unused net variable from ip_vs_out

From: kbuild test robot <hidden>
Date: 2015-10-02 00:53:19

Hi Simon,

[auto build test results on next-20151001 -- if it's inappropriate base, please ignore]

config: i386-randconfig-i1-201539 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

   net/netfilter/ipvs/ip_vs_core.c: In function 'ip_vs_out':
quoted
net/netfilter/ipvs/ip_vs_core.c:1276:18: error: 'net' undeclared (first use in this function)
          skb->dev = net->loopback_dev;
                     ^
   net/netfilter/ipvs/ip_vs_core.c:1276:18: note: each undeclared identifier is reported only once for each function it appears in

vim +/net +1276 net/netfilter/ipvs/ip_vs_core.c

2906f66a net/netfilter/ipvs/ip_vs_core.c Venkata Mohan Reddy 2010-02-18  1270  				 || (iph.protocol == IPPROTO_SCTP
2906f66a net/netfilter/ipvs/ip_vs_core.c Venkata Mohan Reddy 2010-02-18  1271  					&& !is_sctp_abort(skb,
2906f66a net/netfilter/ipvs/ip_vs_core.c Venkata Mohan Reddy 2010-02-18  1272  						iph.len)))) {
2a3b791e net/ipv4/ipvs/ip_vs_core.c      Julius Volz         2008-09-02  1273  #ifdef CONFIG_IP_VS_IPV6
cb59155f net/netfilter/ipvs/ip_vs_core.c Julian Anastasov    2010-10-17  1274  				if (af == AF_INET6) {
cb59155f net/netfilter/ipvs/ip_vs_core.c Julian Anastasov    2010-10-17  1275  					if (!skb->dev)
cb59155f net/netfilter/ipvs/ip_vs_core.c Julian Anastasov    2010-10-17 @1276  						skb->dev = net->loopback_dev;
2a3b791e net/ipv4/ipvs/ip_vs_core.c      Julius Volz         2008-09-02  1277  					icmpv6_send(skb,
2a3b791e net/ipv4/ipvs/ip_vs_core.c      Julius Volz         2008-09-02  1278  						    ICMPV6_DEST_UNREACH,
2a3b791e net/ipv4/ipvs/ip_vs_core.c      Julius Volz         2008-09-02  1279  						    ICMPV6_PORT_UNREACH,

:::::: The code at line 1276 was first introduced by commit
:::::: cb59155f21d4c0507d2034c2953f6a3f7806913d ipvs: changes for local client

:::::: TO: Julian Anastasov [off-list ref]
:::::: CC: Simon Horman [off-list ref]

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Re: [PATCH] ipvs: Remove unused net variable from ip_vs_out

From: Julian Anastasov <ja@ssi.bg>
Date: 2015-10-06 06:35:54

	Hello,

On Fri, 2 Oct 2015, Simon Horman wrote:
quoted hunk
Since 6f2bcea9917d ("ipvs: Pass ipvs into ip_vs_in_icmp and ip_vs_in_icmp_v6")
the net net variable in ip_vs_out() appears to be unused so remove it.

Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_core.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index d08df435c2aa..72b6a44ea9de 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;
	So, this line should be moved into the block
where the var is used?

Regards

--
Julian Anastasov [off-list ref]

Re: [PATCH] ipvs: Remove unused net variable from ip_vs_out

From: Simon Horman <horms@verge.net.au>
Date: 2015-10-06 07:33:36

On Tue, Oct 06, 2015 at 09:35:29AM +0300, Julian Anastasov wrote:
	Hello,

On Fri, 2 Oct 2015, Simon Horman wrote:
quoted
Since 6f2bcea9917d ("ipvs: Pass ipvs into ip_vs_in_icmp and ip_vs_in_icmp_v6")
the net net variable in ip_vs_out() appears to be unused so remove it.

Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_core.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index d08df435c2aa..72b6a44ea9de 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;
	So, this line should be moved into the block
where the var is used?
Indeed, I'll send an updated patch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help