aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/digital_dep.c
diff options
context:
space:
mode:
authorThierry Escande <thierry.escande@linux.intel.com>2014-01-02 05:58:14 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2014-01-03 21:35:34 -0500
commit4f319e3251937a73719b13397d738640622ba513 (patch)
tree70da83a14832304cff45ce054d368461d4113dcc /net/nfc/digital_dep.c
parent67af1d7a0fb4b5397cb093c0fe98d5b95516c228 (diff)
NFC: digital: Use NFC_NFCID3_MAXSIZE from nfc.h
This removes the declaration of NFCID3 size in digital_dep.c and now uses the one from nfc.h. This also removes a faulty and unneeded call to max(). Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/digital_dep.c')
-rw-r--r--net/nfc/digital_dep.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/nfc/digital_dep.c b/net/nfc/digital_dep.c
index e42ecb66e712..470a0b4016ed 100644
--- a/net/nfc/digital_dep.c
+++ b/net/nfc/digital_dep.c
@@ -32,7 +32,6 @@
32#define DIGITAL_ATR_REQ_MIN_SIZE 16 32#define DIGITAL_ATR_REQ_MIN_SIZE 16
33#define DIGITAL_ATR_REQ_MAX_SIZE 64 33#define DIGITAL_ATR_REQ_MAX_SIZE 64
34 34
35#define DIGITAL_NFCID3_LEN ((u8)8)
36#define DIGITAL_LR_BITS_PAYLOAD_SIZE_254B 0x30 35#define DIGITAL_LR_BITS_PAYLOAD_SIZE_254B 0x30
37#define DIGITAL_GB_BIT 0x02 36#define DIGITAL_GB_BIT 0x02
38 37
@@ -206,10 +205,9 @@ int digital_in_send_atr_req(struct nfc_digital_dev *ddev,
206 atr_req->dir = DIGITAL_NFC_DEP_FRAME_DIR_OUT; 205 atr_req->dir = DIGITAL_NFC_DEP_FRAME_DIR_OUT;
207 atr_req->cmd = DIGITAL_CMD_ATR_REQ; 206 atr_req->cmd = DIGITAL_CMD_ATR_REQ;
208 if (target->nfcid2_len) 207 if (target->nfcid2_len)
209 memcpy(atr_req->nfcid3, target->nfcid2, 208 memcpy(atr_req->nfcid3, target->nfcid2, NFC_NFCID2_MAXSIZE);
210 max(target->nfcid2_len, DIGITAL_NFCID3_LEN));
211 else 209 else
212 get_random_bytes(atr_req->nfcid3, DIGITAL_NFCID3_LEN); 210 get_random_bytes(atr_req->nfcid3, NFC_NFCID3_MAXSIZE);
213 211
214 atr_req->did = 0; 212 atr_req->did = 0;
215 atr_req->bs = 0; 213 atr_req->bs = 0;