summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/marvell/mwifiex/cmdevt.c
diff options
context:
space:
mode:
authorDevidas Puranik <devidas@marvell.com>2017-03-09 14:06:17 +0530
committerKalle Valo <kvalo@codeaurora.org>2017-03-20 19:05:21 +0200
commit92c70a958b0b6b7e729a47a7c85762636859eee9 (patch)
treeb0fa2fa9fef5e6c84605f38f2445627d5737362e /drivers/net/wireless/marvell/mwifiex/cmdevt.c
parent5653c6462f56e13cb943cd572fdae9252157a523 (diff)
downloadop-kernel-dev-92c70a958b0b6b7e729a47a7c85762636859eee9.zip
op-kernel-dev-92c70a958b0b6b7e729a47a7c85762636859eee9.tar.gz
mwifiex: fix for unaligned reads
Using the accessor function e.g. get_unaligned_le32 instead of le32_to_cpu to avoid the unaligned access. This is for the architectures that don't handle the unaligned memory access Signed-off-by: Devidas Puranik <devidas@marvell.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/cmdevt.c')
-rw-r--r--drivers/net/wireless/marvell/mwifiex/cmdevt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
index 25a7475..0c3b217 100644
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
@@ -242,7 +242,7 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
mwifiex_dbg(adapter, CMD,
"cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n",
cmd_code,
- le16_to_cpu(*(__le16 *)((u8 *)host_cmd + S_DS_GEN)),
+ get_unaligned_le16((u8 *)host_cmd + S_DS_GEN),
cmd_size, le16_to_cpu(host_cmd->seq_num));
mwifiex_dbg_dump(adapter, CMD_D, "cmd buffer:", host_cmd, cmd_size);
@@ -286,7 +286,7 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
(adapter->dbg.last_cmd_index + 1) % DBG_CMD_NUM;
adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index] = cmd_code;
adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index] =
- le16_to_cpu(*(__le16 *) ((u8 *) host_cmd + S_DS_GEN));
+ get_unaligned_le16((u8 *)host_cmd + S_DS_GEN);
/* Clear BSS_NO_BITS from HostCmd */
cmd_code &= HostCmd_CMD_ID_MASK;
OpenPOWER on IntegriCloud