summaryrefslogtreecommitdiff
path: root/net/bluetooth/l2cap.c
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2010-05-01 16:15:43 -0300
committerMarcel Holtmann <marcel@holtmann.org>2010-05-10 09:28:51 +0200
commit44651b85cc3a076147af5d181fc4833ef8debc59 (patch)
treee220ae53e65e37b22c2f399c69d73b14845eedbc /net/bluetooth/l2cap.c
parent01760bdde9a92413b7fff928d08e19352bf09d82 (diff)
downloadlwn-44651b85cc3a076147af5d181fc4833ef8debc59.tar.gz
lwn-44651b85cc3a076147af5d181fc4833ef8debc59.zip
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/bluetooth/l2cap.c')
-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
__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;
}
@@ -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)