skbuff/mac80211: introduce and use skb_put_zero()
This pattern was introduced a number of times in mac80211 just now, and since it's present in a number of other places it makes sense to add a little helper for it. This just adds the helper and transforms the mac80211 code, a later patch will transform other places. Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
@@ -1937,6 +1937,15 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len)
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline unsigned char *skb_put_zero(struct sk_buff *skb, unsigned int len)
|
||||
{
|
||||
unsigned char *tmp = skb_put(skb, len);
|
||||
|
||||
memset(tmp, 0, len);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
unsigned char *skb_push(struct sk_buff *skb, unsigned int len);
|
||||
static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
|
||||
{
|
||||
|
Reference in New Issue
Block a user