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>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user