summaryrefslogtreecommitdiff
path: root/drivers/nfc/nxp-nci
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-04-17 00:42:22 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2017-04-17 00:42:22 +0200
commit4ea206395d3aede32bab94a75ec573530486fa44 (patch)
tree69c9d431bb02be210886f673c6fe467327cc156c /drivers/nfc/nxp-nci
parent8b55d7581fc5dccc658b9a169879c46dda807d5e (diff)
nfc: fix get_unaligned_...() misuses
* if a local variable of type uint16_t is unaligned, your compiler is FUBAR * the whole point of get_unaligned_... is to avoid memcpy + ..._to_cpu(). Using it *after* memcpy() (into aligned object, no less) is pointless. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc/nxp-nci')
-rw-r--r--drivers/nfc/nxp-nci/i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index c6a04a950225..ff22d761183c 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -126,7 +126,7 @@ static int nxp_nci_i2c_fw_read(struct nxp_nci_i2c_phy *phy,
goto fw_read_exit;
}
- frame_len = (get_unaligned_be16(&header) & NXP_NCI_FW_FRAME_LEN_MASK) +
+ frame_len = (be16_to_cpu(header) & NXP_NCI_FW_FRAME_LEN_MASK) +
NXP_NCI_FW_CRC_LEN;
*skb = alloc_skb(NXP_NCI_FW_HDR_LEN + frame_len, GFP_KERNEL);