Skip to contentSkip to conversation

ipv6: remove unused function ipv6_skb_idev()

PATCH Applied Lukas Bulwahn 3 participants 3 messages Nov 13, 2020 – Nov 14, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: remove unused function ipv6_skb_idev()

Commit bdb7cc643fc9 ("ipv6: Count interface receive statistics on the ingress netdev") removed all callees for ipv6_skb_idev(). Hence, since then, ipv6_skb_idev() is unused and make CC=clang W=1 warns:

net/ipv6/exthdrs.c:909:33:
warning: unused function 'ipv6_skb_idev' [-Wunused-function]

So, remove this unused function and a -Wunused-function warning.

---
Alexey, Hideaki-san, please ack.

David, Jakub, please pick this minor non-urgent clean-up patch.

 net/ipv6/exthdrs.c | 4 ----
 1 file changed, 4 deletions(-)
net/ipv6/exthdrs.c +0 -4
index 374105e4394f..584d1b06eb90 100644
@@ -906,10 +906,6 @@ void ipv6_exthdrs_exit(void)
 /*
  * Note: we cannot rely on skb_dst(skb) before we assign it in ip6_route_input().
  */
-static inline struct inet6_dev *ipv6_skb_idev(struct sk_buff *skb)
-{
-	return skb_dst(skb) ? ip6_dst_idev(skb_dst(skb)) : __in6_dev_get(skb->dev);
-}
 
 static inline struct net *ipv6_skb_net(struct sk_buff *skb)
 {
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Lukas Bulwahn

Commit bdb7cc643fc9 ("ipv6: Count interface receive statistics on the ingress netdev") removed all callees for ipv6_skb_idev(). Hence, since then, ipv6_skb_idev() is unused and make CC=clang W=1 warns:

net/ipv6/exthdrs.c:909:33:
warning: unused function 'ipv6_skb_idev' [-Wunused-function]

So, remove this unused function and a -Wunused-function warning.

Quoted 26 lines

---
Alexey, Hideaki-san, please ack.

David, Jakub, please pick this minor non-urgent clean-up patch.

 net/ipv6/exthdrs.c | 4 ----
 1 file changed, 4 deletions(-)
net/ipv6/exthdrs.c +0 -4
index 374105e4394f..584d1b06eb90 100644
@@ -906,10 +906,6 @@ void ipv6_exthdrs_exit(void)
 /*
  * Note: we cannot rely on skb_dst(skb) before we assign it in ip6_route_input().
  */
-static inline struct inet6_dev *ipv6_skb_idev(struct sk_buff *skb)
-{
-	return skb_dst(skb) ? ip6_dst_idev(skb_dst(skb)) : __in6_dev_get(skb->dev);
-}
 
 static inline struct net *ipv6_skb_net(struct sk_buff *skb)
 {
Signature · 1 line
2.17.1
maintainer Applied
#2 lore raw
Quoted 5 lines · On Fri, 13 Nov 2020 11:36:49 -0700 Nathan Chancellor wrote:
Quoted 4 lines · Lukas Bulwahn

Commit bdb7cc643fc9 ("ipv6: Count interface receive statistics on the ingress netdev") removed all callees for ipv6_skb_idev(). Hence, since then, ipv6_skb_idev() is unused and make CC=clang W=1 warns:

Quoted 8 lines
Quoted 6 lines

net/ipv6/exthdrs.c:909:33:
warning: unused function 'ipv6_skb_idev' [-Wunused-function]

So, remove this unused function and a -Wunused-function warning.

Applied, thanks!