summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/marvell/mwifiex/util.h
diff options
context:
space:
mode:
authorDaniel Mentz <danielmentz@google.com>2017-03-09 11:36:16 +0300
committerKalle Valo <kvalo@codeaurora.org>2017-03-20 20:05:21 +0300
commit5653c6462f56e13cb943cd572fdae9252157a523 (patch)
tree3bdb0b12ddc8ec0a33ec2bcfa8f4e8a5e6250ea3 /drivers/net/wireless/marvell/mwifiex/util.h
parent5c0b87987432ad9d2c7068dc739d9f21bb6ff72e (diff)
downloadlinux-5653c6462f56e13cb943cd572fdae9252157a523.tar.xz
mwifiex: Use accessors routines for unaligned values
Synopsys' ARCompact architecture does not support loading from or storing values to unaligned memory locations. We saw a series of misaligned access exceptions on ARC. To work around this issue, we bulk replaced le16_to_cpu and le32_to_cpu with get_unaligned_le16 and get_unaligned_le32, respectively. We also added le16_unaligned_add_cpu which is similar to le16_add_cpu but works with unaligned values. Signed-off-by: Daniel Mentz <danielmentz@google.com> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell/mwifiex/util.h')
-rw-r--r--drivers/net/wireless/marvell/mwifiex/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/util.h b/drivers/net/wireless/marvell/mwifiex/util.h
index b541d66c01eb..c386992abcdb 100644
--- a/drivers/net/wireless/marvell/mwifiex/util.h
+++ b/drivers/net/wireless/marvell/mwifiex/util.h
@@ -93,4 +93,9 @@ static inline dma_addr_t MWIFIEX_SKB_DMA_ADDR(struct sk_buff *skb)
int mwifiex_debug_info_to_buffer(struct mwifiex_private *priv, char *buf,
struct mwifiex_debug_info *info);
+static inline void le16_unaligned_add_cpu(__le16 *var, u16 val)
+{
+ put_unaligned_le16(get_unaligned_le16(var) + val, var);
+}
+
#endif /* !_MWIFIEX_UTIL_H_ */