aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2010-05-01 15:15:43 -0400
committerMarcel Holtmann <marcel@holtmann.org>2010-05-10 03:28:51 -0400
commit44651b85cc3a076147af5d181fc4833ef8debc59 (patch)
treee220ae53e65e37b22c2f399c69d73b14845eedbc /net
parent01760bdde9a92413b7fff928d08e19352bf09d82 (diff)
Bluetooth: Don't set control bits to zero first
We can set the SAR bits in the control field directly. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/l2cap.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 31514d8faa66..cfb18cd97564 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1636,16 +1636,15 @@ static inline int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, siz
1636 __skb_queue_tail(&sar_queue, skb); 1636 __skb_queue_tail(&sar_queue, skb);
1637 len -= pi->remote_mps; 1637 len -= pi->remote_mps;
1638 size += pi->remote_mps; 1638 size += pi->remote_mps;
1639 control = 0;
1640 1639
1641 while (len > 0) { 1640 while (len > 0) {
1642 size_t buflen; 1641 size_t buflen;
1643 1642
1644 if (len > pi->remote_mps) { 1643 if (len > pi->remote_mps) {
1645 control |= L2CAP_SDU_CONTINUE; 1644 control = L2CAP_SDU_CONTINUE;
1646 buflen = pi->remote_mps; 1645 buflen = pi->remote_mps;
1647 } else { 1646 } else {
1648 control |= L2CAP_SDU_END; 1647 control = L2CAP_SDU_END;
1649 buflen = len; 1648 buflen = len;
1650 } 1649 }
1651 1650
@@ -1658,7 +1657,6 @@ static inline int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, siz
1658 __skb_queue_tail(&sar_queue, skb); 1657 __skb_queue_tail(&sar_queue, skb);
1659 len -= buflen; 1658 len -= buflen;
1660 size += buflen; 1659 size += buflen;
1661 control = 0;
1662 } 1660 }
1663 skb_queue_splice_tail(&sar_queue, TX_QUEUE(sk)); 1661 skb_queue_splice_tail(&sar_queue, TX_QUEUE(sk));
1664 if (sk->sk_send_head == NULL) 1662 if (sk->sk_send_head == NULL)