Skip to content

Commit d626f62

Browse files
acmelDavid S. Miller
authored and
David S. Miller
committedApr 26, 2007
[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 <[email protected]>
1 parent 2a123b8 commit d626f62

File tree

133 files changed

+321
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+321
-230
lines changed
 

‎arch/ia64/sn/kernel/xpnet.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,8 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
566566
msg->version = XPNET_VERSION_EMBED;
567567
dev_dbg(xpnet, "calling memcpy(0x%p, 0x%p, 0x%lx)\n",
568568
&msg->data, skb->data, (size_t) embedded_bytes);
569-
memcpy(&msg->data, skb->data, (size_t) embedded_bytes);
569+
skb_copy_from_linear_data(skb, &msg->data,
570+
(size_t)embedded_bytes);
570571
} else {
571572
msg->version = XPNET_VERSION;
572573
}

‎drivers/atm/atmtcp.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
221221
hdr->vpi = htons(vcc->vpi);
222222
hdr->vci = htons(vcc->vci);
223223
hdr->length = htonl(skb->len);
224-
memcpy(skb_put(new_skb,skb->len),skb->data,skb->len);
224+
skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len);
225225
if (vcc->pop) vcc->pop(vcc,skb);
226226
else dev_kfree_skb(skb);
227227
out_vcc->push(out_vcc,new_skb);
@@ -310,7 +310,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
310310
goto done;
311311
}
312312
__net_timestamp(new_skb);
313-
memcpy(skb_put(new_skb,skb->len),skb->data,skb->len);
313+
skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len);
314314
out_vcc->push(out_vcc,new_skb);
315315
atomic_inc(&vcc->stats->tx);
316316
atomic_inc(&out_vcc->stats->rx);

0 commit comments

Comments
 (0)
Please sign in to comment.