aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-05-24 09:07:47 +0200
committerJohannes Berg <johannes.berg@intel.com>2017-05-30 09:14:30 +0200
commite45a79da863c199d7c47b1ee6d33cee23c89eac1 (patch)
treee34820823df14da003c96f85075499f4af77a2fc /include/linux/skbuff.h
parentmac80211: enable VHT for mesh channel processing (diff)
downloadlinux-dev-e45a79da863c199d7c47b1ee6d33cee23c89eac1.tar.xz
linux-dev-e45a79da863c199d7c47b1ee6d33cee23c89eac1.zip
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>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index bfc7892f6c33..d92056b2da44 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -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)
{