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>
This commit is contained in:
Gustavo F. Padovan
2010-05-01 16:15:43 -03:00
committed by Marcel Holtmann
parent 01760bdde9
commit 44651b85cc

View File

@@ -1636,16 +1636,15 @@ static inline int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, siz
__skb_queue_tail(&sar_queue, skb); __skb_queue_tail(&sar_queue, skb);
len -= pi->remote_mps; len -= pi->remote_mps;
size += pi->remote_mps; size += pi->remote_mps;
control = 0;
while (len > 0) { while (len > 0) {
size_t buflen; size_t buflen;
if (len > pi->remote_mps) { if (len > pi->remote_mps) {
control |= L2CAP_SDU_CONTINUE; control = L2CAP_SDU_CONTINUE;
buflen = pi->remote_mps; buflen = pi->remote_mps;
} else { } else {
control |= L2CAP_SDU_END; control = L2CAP_SDU_END;
buflen = len; buflen = len;
} }
@@ -1658,7 +1657,6 @@ static inline int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, siz
__skb_queue_tail(&sar_queue, skb); __skb_queue_tail(&sar_queue, skb);
len -= buflen; len -= buflen;
size += buflen; size += buflen;
control = 0;
} }
skb_queue_splice_tail(&sar_queue, TX_QUEUE(sk)); skb_queue_splice_tail(&sar_queue, TX_QUEUE(sk));
if (sk->sk_send_head == NULL) if (sk->sk_send_head == NULL)