Skip to content

Commit

Permalink
Bluetooth: Don't set control bits to zero first
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gustavo F. Padovan authored and Marcel Holtmann committed May 10, 2010
1 parent 01760bd commit 44651b8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1636,16 +1636,15 @@ static inline int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, siz
__skb_queue_tail(&sar_queue, skb);
len -= pi->remote_mps;
size += pi->remote_mps;
control = 0;

while (len > 0) {
size_t buflen;

if (len > pi->remote_mps) {
control |= L2CAP_SDU_CONTINUE;
control = L2CAP_SDU_CONTINUE;
buflen = pi->remote_mps;
} else {
control |= L2CAP_SDU_END;
control = L2CAP_SDU_END;
buflen = len;
}

Expand All @@ -1658,7 +1657,6 @@ static inline int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, siz
__skb_queue_tail(&sar_queue, skb);
len -= buflen;
size += buflen;
control = 0;
}
skb_queue_splice_tail(&sar_queue, TX_QUEUE(sk));
if (sk->sk_send_head == NULL)
Expand Down

0 comments on commit 44651b8

Please sign in to comment.