@@ -499,7 +499,7 @@ static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate,
targets->supported_protocols =
nfc_hci_sak_to_protocol(skb->data[MICROREAD_EMCF_A_SAK]);
targets->sens_res =
- be16_to_cpu(*(u16 *)&skb->data[MICROREAD_EMCF_A_ATQA]);
+ be16_to_cpup((__be16 *)&skb->data[MICROREAD_EMCF_A_ATQA]);
targets->sel_res = skb->data[MICROREAD_EMCF_A_SAK];
targets->nfcid1_len = skb->data[MICROREAD_EMCF_A_LEN];
if (targets->nfcid1_len > sizeof(targets->nfcid1)) {
@@ -513,7 +513,7 @@ static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate,
targets->supported_protocols =
nfc_hci_sak_to_protocol(skb->data[MICROREAD_EMCF_A3_SAK]);
targets->sens_res =
- be16_to_cpu(*(u16 *)&skb->data[MICROREAD_EMCF_A3_ATQA]);
+ be16_to_cpup((__be16 *)&skb->data[MICROREAD_EMCF_A3_ATQA]);
targets->sel_res = skb->data[MICROREAD_EMCF_A3_SAK];
targets->nfcid1_len = skb->data[MICROREAD_EMCF_A3_LEN];
if (targets->nfcid1_len > sizeof(targets->nfcid1)) {
@@ -531,7 +531,7 @@ static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate,
case MICROREAD_GATE_ID_MREAD_NFC_T1:
targets->supported_protocols = NFC_PROTO_JEWEL_MASK;
targets->sens_res =
- le16_to_cpu(*(u16 *)&skb->data[MICROREAD_EMCF_T1_ATQA]);
+ le16_to_cpup((__le16 *)&skb->data[MICROREAD_EMCF_T1_ATQA]);
memcpy(targets->nfcid1, &skb->data[MICROREAD_EMCF_T1_UID], 4);
targets->nfcid1_len = 4;
break;
Fix sparse warnings: drivers/nfc/microread/microread.c:502:26: warning: cast to restricted __be16 drivers/nfc/microread/microread.c:502:26: warning: cast to restricted __be16 drivers/nfc/microread/microread.c:502:26: warning: cast to restricted __be16 drivers/nfc/microread/microread.c:502:26: warning: cast to restricted __be16 drivers/nfc/microread/microread.c:516:26: warning: cast to restricted __be16 drivers/nfc/microread/microread.c:516:26: warning: cast to restricted __be16 drivers/nfc/microread/microread.c:516:26: warning: cast to restricted __be16 drivers/nfc/microread/microread.c:516:26: warning: cast to restricted __be16 drivers/nfc/microread/microread.c:534:25: warning: cast to restricted __le16 Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> --- drivers/nfc/microread/microread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)