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 /drivers/atm | |
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 'drivers/atm')
-rw-r--r-- | drivers/atm/atmtcp.c | 4 | ||||
-rw-r--r-- | drivers/atm/nicstar.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c index fc518d85543d..1b9493a16aca 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c | |||
@@ -221,7 +221,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb) | |||
221 | hdr->vpi = htons(vcc->vpi); | 221 | hdr->vpi = htons(vcc->vpi); |
222 | hdr->vci = htons(vcc->vci); | 222 | hdr->vci = htons(vcc->vci); |
223 | hdr->length = htonl(skb->len); | 223 | 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); |
225 | if (vcc->pop) vcc->pop(vcc,skb); | 225 | if (vcc->pop) vcc->pop(vcc,skb); |
226 | else dev_kfree_skb(skb); | 226 | else dev_kfree_skb(skb); |
227 | out_vcc->push(out_vcc,new_skb); | 227 | out_vcc->push(out_vcc,new_skb); |
@@ -310,7 +310,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb) | |||
310 | goto done; | 310 | goto done; |
311 | } | 311 | } |
312 | __net_timestamp(new_skb); | 312 | __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); |
314 | out_vcc->push(out_vcc,new_skb); | 314 | out_vcc->push(out_vcc,new_skb); |
315 | atomic_inc(&vcc->stats->tx); | 315 | atomic_inc(&vcc->stats->tx); |
316 | atomic_inc(&out_vcc->stats->rx); | 316 | atomic_inc(&out_vcc->stats->rx); |
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 26f4b7033494..14ced85b3f54 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c | |||
@@ -2395,7 +2395,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe) | |||
2395 | skb->destructor = ns_lb_destructor; | 2395 | skb->destructor = ns_lb_destructor; |
2396 | #endif /* NS_USE_DESTRUCTORS */ | 2396 | #endif /* NS_USE_DESTRUCTORS */ |
2397 | skb_push(skb, NS_SMBUFSIZE); | 2397 | skb_push(skb, NS_SMBUFSIZE); |
2398 | memcpy(skb->data, sb->data, NS_SMBUFSIZE); | 2398 | skb_copy_from_linear_data(sb, skb->data, NS_SMBUFSIZE); |
2399 | skb_put(skb, len - NS_SMBUFSIZE); | 2399 | skb_put(skb, len - NS_SMBUFSIZE); |
2400 | ATM_SKB(skb)->vcc = vcc; | 2400 | ATM_SKB(skb)->vcc = vcc; |
2401 | __net_timestamp(skb); | 2401 | __net_timestamp(skb); |
@@ -2479,7 +2479,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe) | |||
2479 | { | 2479 | { |
2480 | /* Copy the small buffer to the huge buffer */ | 2480 | /* Copy the small buffer to the huge buffer */ |
2481 | sb = (struct sk_buff *) iov->iov_base; | 2481 | sb = (struct sk_buff *) iov->iov_base; |
2482 | memcpy(hb->data, sb->data, iov->iov_len); | 2482 | skb_copy_from_linear_data(sb, hb->data, iov->iov_len); |
2483 | skb_put(hb, iov->iov_len); | 2483 | skb_put(hb, iov->iov_len); |
2484 | remaining = len - iov->iov_len; | 2484 | remaining = len - iov->iov_len; |
2485 | iov++; | 2485 | iov++; |
@@ -2491,7 +2491,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe) | |||
2491 | { | 2491 | { |
2492 | lb = (struct sk_buff *) iov->iov_base; | 2492 | lb = (struct sk_buff *) iov->iov_base; |
2493 | tocopy = min_t(int, remaining, iov->iov_len); | 2493 | tocopy = min_t(int, remaining, iov->iov_len); |
2494 | memcpy(skb_tail_pointer(hb), lb->data, tocopy); | 2494 | skb_copy_from_linear_data(lb, skb_tail_pointer(hb), tocopy); |
2495 | skb_put(hb, tocopy); | 2495 | skb_put(hb, tocopy); |
2496 | iov++; | 2496 | iov++; |
2497 | remaining -= tocopy; | 2497 | remaining -= tocopy; |