This patch removes the swap pointer and memmove functionality. Instead
we use the well known put/get unaligned access with specific byte order
handling.
Signed-off-by: Alexander Aring <[email protected]>
Suggested-by: Marc Kleine-Budde <[email protected]>
---
include/net/mac802154.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/net/mac802154.h b/include/net/mac802154.h
index 2e3cdd20..6cd7a70 100644
--- a/include/net/mac802154.h
+++ b/include/net/mac802154.h
@@ -16,10 +16,10 @@
#ifndef NET_MAC802154_H
#define NET_MAC802154_H
+#include <asm/unaligned.h>
#include <net/af_ieee802154.h>
#include <linux/ieee802154.h>
#include <linux/skbuff.h>
-#include <linux/unaligned/memmove.h>
#include <net/cfg802154.h>
@@ -254,7 +254,7 @@ static inline __le16 ieee802154_get_fc_from_skb(const struct sk_buff *skb)
return cpu_to_le16(0);
}
- return (__force __le16)__get_unaligned_memmove16(skb_mac_header(skb));
+ return get_unaligned_le16(skb_mac_header(skb));
}
/**
@@ -264,7 +264,7 @@ static inline __le16 ieee802154_get_fc_from_skb(const struct sk_buff *skb)
*/
static inline void ieee802154_be64_to_le64(void *le64_dst, const void *be64_src)
{
- __put_unaligned_memmove64(swab64p(be64_src), le64_dst);
+ put_unaligned_le64(get_unaligned_be64(be64_src), le64_dst);
}
/**
@@ -274,7 +274,7 @@ static inline void ieee802154_be64_to_le64(void *le64_dst, const void *be64_src)
*/
static inline void ieee802154_le64_to_be64(void *be64_dst, const void *le64_src)
{
- __put_unaligned_memmove64(swab64p(le64_src), be64_dst);
+ put_unaligned_be64(get_unaligned_le64(le64_src), be64_dst);
}
/**
@@ -284,7 +284,7 @@ static inline void ieee802154_le64_to_be64(void *be64_dst, const void *le64_src)
*/
static inline void ieee802154_le16_to_be16(void *be16_dst, const void *le16_src)
{
- __put_unaligned_memmove16(swab16p(le16_src), be16_dst);
+ put_unaligned_be16(get_unaligned_le16(le16_src), be16_dst);
}
/**
--
2.7.2
Hi Alex,
> This patch removes the swap pointer and memmove functionality. Instead
> we use the well known put/get unaligned access with specific byte order
> handling.
>
> Signed-off-by: Alexander Aring <[email protected]>
> Suggested-by: Marc Kleine-Budde <[email protected]>
> ---
> include/net/mac802154.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
Hi Alex,
> This patch solves the sparse warning:
>
> net/6lowpan/debugfs.c:164:30: warning: symbol 'lowpan_ctx_pfx_fops' was
> not declared. Should it be static?
> net/6lowpan/debugfs.c:241:30: warning: symbol 'lowpan_context_fops' was
> not declared. Should it be static?
>
> Signed-off-by: Alexander Aring <[email protected]>
> ---
> net/6lowpan/debugfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
This patch solves the sparse warning:
net/6lowpan/debugfs.c:164:30: warning: symbol 'lowpan_ctx_pfx_fops' was
not declared. Should it be static?
net/6lowpan/debugfs.c:241:30: warning: symbol 'lowpan_context_fops' was
not declared. Should it be static?
Signed-off-by: Alexander Aring <[email protected]>
---
net/6lowpan/debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/6lowpan/debugfs.c b/net/6lowpan/debugfs.c
index aa49ff4..0793a81 100644
--- a/net/6lowpan/debugfs.c
+++ b/net/6lowpan/debugfs.c
@@ -161,7 +161,7 @@ out:
return status;
}
-const struct file_operations lowpan_ctx_pfx_fops = {
+static const struct file_operations lowpan_ctx_pfx_fops = {
.open = lowpan_ctx_pfx_open,
.read = seq_read,
.write = lowpan_ctx_pfx_write,
@@ -238,7 +238,7 @@ static int lowpan_context_open(struct inode *inode, struct file *file)
return single_open(file, lowpan_context_show, inode->i_private);
}
-const struct file_operations lowpan_context_fops = {
+static const struct file_operations lowpan_context_fops = {
.open = lowpan_context_open,
.read = seq_read,
.llseek = seq_lseek,
--
2.7.2