diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-27 17:55:52 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:28:23 -0400 |
commit | d626f62b11e00c16e81e4308ab93d3f13551812a (patch) | |
tree | fac4af6ced853755e12fc709d55f0c2bec51265d /net/bluetooth/l2cap.c | |
parent | 2a123b86e2b242a4a6db990d2851d45e192f88e5 (diff) |
[SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}
To clearly state the intent of copying from linear sk_buffs, _offset being a
overly long variant but interesting for the sake of saving some bytes.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'net/bluetooth/l2cap.c')
-rw-r--r-- | net/bluetooth/l2cap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 162eab6a4478..a5867879b615 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -2107,7 +2107,8 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 fl | |||
2107 | if (!(conn->rx_skb = bt_skb_alloc(len, GFP_ATOMIC))) | 2107 | if (!(conn->rx_skb = bt_skb_alloc(len, GFP_ATOMIC))) |
2108 | goto drop; | 2108 | goto drop; |
2109 | 2109 | ||
2110 | memcpy(skb_put(conn->rx_skb, skb->len), skb->data, skb->len); | 2110 | skb_copy_from_linear_data(skb, skb_put(conn->rx_skb, skb->len), |
2111 | skb->len); | ||
2111 | conn->rx_len = len - skb->len; | 2112 | conn->rx_len = len - skb->len; |
2112 | } else { | 2113 | } else { |
2113 | BT_DBG("Cont: frag len %d (expecting %d)", skb->len, conn->rx_len); | 2114 | BT_DBG("Cont: frag len %d (expecting %d)", skb->len, conn->rx_len); |
@@ -2128,7 +2129,8 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 fl | |||
2128 | goto drop; | 2129 | goto drop; |
2129 | } | 2130 | } |
2130 | 2131 | ||
2131 | memcpy(skb_put(conn->rx_skb, skb->len), skb->data, skb->len); | 2132 | skb_copy_from_linear_data(skb, skb_put(conn->rx_skb, skb->len), |
2133 | skb->len); | ||
2132 | conn->rx_len -= skb->len; | 2134 | conn->rx_len -= skb->len; |
2133 | 2135 | ||
2134 | if (!conn->rx_len) { | 2136 | if (!conn->rx_len) { |