From: Tomas Winkler <tomas.winkler@intel.com>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>,
Aloisio Almeida Jr <aloisio.almeida@openbossa.org>,
linux-wireless@vger.kernel.org,
Tomas Winkler <tomas.winkler@intel.com>
Subject: [PATCH 2/2] nfc/microread: use correct casting in microread_target_discovered()
Date: Sun, 21 Apr 2019 12:12:36 +0300 [thread overview]
Message-ID: <20190421091236.19168-3-tomas.winkler@intel.com> (raw)
In-Reply-To: <20190421091236.19168-1-tomas.winkler@intel.com>
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 --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;
--
2.20.1
prev parent reply other threads:[~2019-04-21 9:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-21 9:12 [PATCH 0/2] nfc: compilation cleanups Tomas Winkler
2019-04-21 9:12 ` [PATCH 1/2] nfc/pn544: fix inconsistent indenting Tomas Winkler
2019-04-21 9:12 ` Tomas Winkler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190421091236.19168-3-tomas.winkler@intel.com \
--to=tomas.winkler@intel.com \
--cc=aloisio.almeida@openbossa.org \
--cc=lauro.venancio@openbossa.org \
--cc=linux-wireless@vger.kernel.org \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox