diff mbox series

[2/2] nfc/microread: use correct casting in microread_target_discovered()

Message ID 20190421091236.19168-3-tomas.winkler@intel.com (mailing list archive)
State Deferred
Delegated to: Samuel Ortiz
Headers show
Series nfc: compilation cleanups | expand

Commit Message

Winkler, Tomas April 21, 2019, 9:12 a.m. UTC
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(-)
diff mbox series

Patch

diff --git a/drivers/nfc/microread/microread.c b/drivers/nfc/microread/microread.c
index e5d5d2d97409..cc1fc8d2b04d 100644
--- a/drivers/nfc/microread/microread.c
+++ b/drivers/nfc/microread/microread.c
@@ -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;