Thread (6 messages) flat view 6 messages, 3 authors, 2015-03-10

Re: [PATCH] can: use sock_efree instead of own destructor

From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: 2015-03-10 06:14:22
Also in: linux-can

On 10.03.2015 04:48, Florian Westphal wrote:
It is identical to the can destructor.

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>

Hello Florian,

the other callers use it in the same way so it's a good simplification.
Btw. the name of sock_efree() is a bit misleading - nothing is free'd here.

Won't it be better to rename sock_efree(skb) with sock_put_skb(skb) or 
something like that? sock_efree() has no comment why it's named like this.

Regards,
Oliver

ps. changed from linux ML to netdev and linux-can ML in CC
quoted hunk
---
  include/linux/can/skb.h | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h
index cc00d15..b6a52a4 100644
--- a/include/linux/can/skb.h
+++ b/include/linux/can/skb.h
@@ -44,16 +44,11 @@ static inline void can_skb_reserve(struct sk_buff *skb)
  	skb_reserve(skb, sizeof(struct can_skb_priv));
  }

-static inline void can_skb_destructor(struct sk_buff *skb)
-{
-	sock_put(skb->sk);
-}
-
  static inline void can_skb_set_owner(struct sk_buff *skb, struct sock *sk)
  {
  	if (sk) {
  		sock_hold(sk);
-		skb->destructor = can_skb_destructor;
+		skb->destructor = sock_efree;
  		skb->sk = sk;
  	}
  }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help