Bluetooth: Remove redundant setting to zero of bt_cb
authorJohan Hedberg <johan.hedberg@intel.com>
Thu, 5 Nov 2015 07:31:39 +0000 (09:31 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 19 Nov 2015 16:50:27 +0000 (17:50 +0100)
The socket allocation functions will always memset skb->cb to zero so
there's no need to make other initializations needing the same thing.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/bluetooth.h

index 663e0ef1eaa0425cc5befcff5741d0fcb7600dbb..a85e6d3d75ef287462ce76392c9b990282ef297d 100644 (file)
@@ -325,10 +325,8 @@ static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how)
        struct sk_buff *skb;
 
        skb = alloc_skb(len + BT_SKB_RESERVE, how);
-       if (skb) {
+       if (skb)
                skb_reserve(skb, BT_SKB_RESERVE);
-               bt_cb(skb)->incoming  = 0;
-       }
        return skb;
 }
 
@@ -338,10 +336,8 @@ static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk,
        struct sk_buff *skb;
 
        skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err);
-       if (skb) {
+       if (skb)
                skb_reserve(skb, BT_SKB_RESERVE);
-               bt_cb(skb)->incoming  = 0;
-       }
 
        if (!skb && *err)
                return NULL;