Bluetooth: Remove unneeded calculation and magic number
[deliverable/linux.git] / net / bluetooth / l2cap_core.c
index 7acd884f1c3e5edfea193e6c95828cea4fe9a114..fcd09fb4b94c1a9d37b96023186dc2edafbeab3f 100644 (file)
@@ -1875,8 +1875,8 @@ static struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan,
        /* Create L2CAP header */
        lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE);
        lh->cid = cpu_to_le16(chan->dcid);
-       lh->len = cpu_to_le16(len + (hlen - L2CAP_HDR_SIZE));
-       put_unaligned(chan->psm, skb_put(skb, 2));
+       lh->len = cpu_to_le16(len + L2CAP_PSMLEN_SIZE);
+       put_unaligned(chan->psm, skb_put(skb, L2CAP_PSMLEN_SIZE));
 
        err = l2cap_skbuff_fromiovec(chan, msg, len, count, skb);
        if (unlikely(err < 0)) {
This page took 0.028884 seconds and 5 git commands to generate.