diff options
author | Johannes Berg <johannes.berg@intel.com> | 2017-05-24 10:07:47 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-05-30 10:14:30 +0300 |
commit | e45a79da863c199d7c47b1ee6d33cee23c89eac1 (patch) | |
tree | e34820823df14da003c96f85075499f4af77a2fc /include/linux/skbuff.h | |
parent | 71ec289e62f9cf9face6acfab65da02ef6bc3478 (diff) | |
download | linux-e45a79da863c199d7c47b1ee6d33cee23c89eac1.tar.xz |
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.h | 9 |
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) { |