Bluetooth: Don't set control bits to zero first
authorGustavo F. Padovan <padovan@profusion.mobi>
Sat, 1 May 2010 19:15:43 +0000 (16:15 -0300)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 10 May 2010 07:28:51 +0000 (09:28 +0200)
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>
net/bluetooth/l2cap.c

index 31514d8faa6621b8aaadd438448aecace166c4f9..cfb18cd9756437d55d8baec22c7ed2bc4fd36280 100644 (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);
        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)