* [PATCH] net: ipv6: remove unused code in ipv6_find_hdr()
@ 2017-10-05 18:07 Lin Zhang
2017-10-06 5:15 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Lin Zhang @ 2017-10-05 18:07 UTC (permalink / raw)
To: kuznet, davem, yoshfuji; +Cc: netdev, Lin Zhang
Storing the left length of skb into 'len' actually has no effect
so we can remove it.
Signed-off-by: Lin Zhang <xiaolou4617@gmail.com>
---
net/ipv6/exthdrs_core.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c
index 305e2ed..98096ea 100644
--- a/net/ipv6/exthdrs_core.c
+++ b/net/ipv6/exthdrs_core.c
@@ -187,7 +187,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
{
unsigned int start = skb_network_offset(skb) + sizeof(struct ipv6hdr);
u8 nexthdr = ipv6_hdr(skb)->nexthdr;
- unsigned int len;
bool found;
if (fragoff)
@@ -204,7 +203,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
start = *offset + sizeof(struct ipv6hdr);
nexthdr = ip6->nexthdr;
}
- len = skb->len - start;
do {
struct ipv6_opt_hdr _hdr, *hp;
@@ -273,7 +271,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
if (!found) {
nexthdr = hp->nexthdr;
- len -= hdrlen;
start += hdrlen;
}
} while (!found);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: ipv6: remove unused code in ipv6_find_hdr()
2017-10-05 18:07 [PATCH] net: ipv6: remove unused code in ipv6_find_hdr() Lin Zhang
@ 2017-10-06 5:15 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-10-06 5:15 UTC (permalink / raw)
To: xiaolou4617; +Cc: kuznet, yoshfuji, netdev
From: Lin Zhang <xiaolou4617@gmail.com>
Date: Fri, 6 Oct 2017 02:07:08 +0800
> Storing the left length of skb into 'len' actually has no effect
> so we can remove it.
>
> Signed-off-by: Lin Zhang <xiaolou4617@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-06 5:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-05 18:07 [PATCH] net: ipv6: remove unused code in ipv6_find_hdr() Lin Zhang
2017-10-06 5:15 ` David Miller
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).