提交 5fcc86bd 编写于 作者: J Johan Hedberg 提交者: Marcel Holtmann

Bluetooth: Remove redundant setting to zero of bt_cb

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: NJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 618e8bc2
...@@ -325,10 +325,8 @@ static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how) ...@@ -325,10 +325,8 @@ static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how)
struct sk_buff *skb; struct sk_buff *skb;
skb = alloc_skb(len + BT_SKB_RESERVE, how); skb = alloc_skb(len + BT_SKB_RESERVE, how);
if (skb) { if (skb)
skb_reserve(skb, BT_SKB_RESERVE); skb_reserve(skb, BT_SKB_RESERVE);
bt_cb(skb)->incoming = 0;
}
return skb; return skb;
} }
...@@ -338,10 +336,8 @@ static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, ...@@ -338,10 +336,8 @@ static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk,
struct sk_buff *skb; struct sk_buff *skb;
skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err); skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err);
if (skb) { if (skb)
skb_reserve(skb, BT_SKB_RESERVE); skb_reserve(skb, BT_SKB_RESERVE);
bt_cb(skb)->incoming = 0;
}
if (!skb && *err) if (!skb && *err)
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册