NFC: No need to apply twice the modulo op to LLCP's recv_n
authorSamuel Ortiz <sameo@linux.intel.com>
Tue, 10 Apr 2012 17:43:14 +0000 (19:43 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 12 Apr 2012 19:10:41 +0000 (15:10 -0400)
recv_n is set properly when receiving an HDLC frame.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/nfc/llcp/commands.c
net/nfc/llcp/llcp.c

index ef10ffcb4b6ffb5ed79eecdc8005dccc0de34575..4aa52b8b6c0c5315bc37dc1a56db5f539c414e3a 100644 (file)
@@ -522,7 +522,7 @@ int nfc_llcp_send_rr(struct nfc_llcp_sock *sock)
 
        skb_put(skb, LLCP_SEQUENCE_SIZE);
 
-       skb->data[2] = sock->recv_n % 16;
+       skb->data[2] = sock->recv_n;
 
        skb_queue_head(&local->tx_queue, skb);
 
index d5e87c35002aba74fb8cb2c0ac4a7cb16c388066..2cf01e642566f275c0df84472a24b9e5b7b7b22c 100644 (file)
@@ -428,7 +428,7 @@ static u8 nfc_llcp_nr(struct sk_buff *pdu)
 
 static void nfc_llcp_set_nrns(struct nfc_llcp_sock *sock, struct sk_buff *pdu)
 {
-       pdu->data[2] = (sock->send_n << 4) | (sock->recv_n % 16);
+       pdu->data[2] = (sock->send_n << 4) | (sock->recv_n);
        sock->send_n = (sock->send_n + 1) % 16;
        sock->recv_ack_n = (sock->recv_n - 1) % 16;
 }