diff options
author | Alexander Aring <alex.aring@gmail.com> | 2015-10-13 13:42:59 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-10-21 00:49:25 +0200 |
commit | 478208e3b9988adc7ec2c480f237049aaf7c4609 (patch) | |
tree | a8b546a42284a369063a295f73b2a1bc642dad55 /include/net | |
parent | 8911d7748ca360ef96cb207cc5165eb9c08669e5 (diff) | |
download | linux-478208e3b9988adc7ec2c480f237049aaf7c4609.tar.gz linux-478208e3b9988adc7ec2c480f237049aaf7c4609.tar.bz2 linux-478208e3b9988adc7ec2c480f237049aaf7c4609.zip |
6lowpan: remove lowpan_fetch_skb_u8
This patch removes the lowpan_fetch_skb_u8 function for getting the iphc
bytes. Instead we using the generic which has a len parameter to tell
the amount of bytes to fetch.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/6lowpan.h | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h index ac30ad3d8cd3..4afdbb3ab6d8 100644 --- a/include/net/6lowpan.h +++ b/include/net/6lowpan.h @@ -287,19 +287,20 @@ static inline void raw_dump_inline(const char *caller, char *msg, const unsigned char *buf, int len) { } #endif -static inline int lowpan_fetch_skb_u8(struct sk_buff *skb, u8 *val) -{ - if (unlikely(!pskb_may_pull(skb, 1))) - return -EINVAL; - - *val = skb->data[0]; - skb_pull(skb, 1); - - return 0; -} - -static inline bool lowpan_fetch_skb(struct sk_buff *skb, - void *data, const unsigned int len) +/** + * lowpan_fetch_skb - getting inline data from 6LoWPAN header + * + * This function will pull data from sk buffer and put it into data to + * remove the 6LoWPAN inline data. This function returns true if the + * sk buffer is too small to pull the amount of data which is specified + * by len. + * + * @skb: the buffer where the inline data should be pulled from. + * @data: destination buffer for the inline data. + * @len: amount of data which should be pulled in bytes. + */ +static inline bool lowpan_fetch_skb(struct sk_buff *skb, void *data, + unsigned int len) { if (unlikely(!pskb_may_pull(skb, len))) return true; |