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/isdn/pcbit/capi.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 'drivers/isdn/pcbit/capi.c')
-rw-r--r-- | drivers/isdn/pcbit/capi.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/isdn/pcbit/capi.c b/drivers/isdn/pcbit/capi.c index 47c59e95898d..7b55e151f1b0 100644 --- a/drivers/isdn/pcbit/capi.c +++ b/drivers/isdn/pcbit/capi.c | |||
@@ -429,8 +429,9 @@ int capi_decode_conn_ind(struct pcbit_chan * chan, | |||
429 | if (!(info->data.setup.CallingPN = kmalloc(len - count + 1, GFP_ATOMIC))) | 429 | if (!(info->data.setup.CallingPN = kmalloc(len - count + 1, GFP_ATOMIC))) |
430 | return -1; | 430 | return -1; |
431 | 431 | ||
432 | memcpy(info->data.setup.CallingPN, skb->data + count + 1, | 432 | skb_copy_from_linear_data_offset(skb, count + 1, |
433 | len - count); | 433 | info->data.setup.CallingPN, |
434 | len - count); | ||
434 | info->data.setup.CallingPN[len - count] = 0; | 435 | info->data.setup.CallingPN[len - count] = 0; |
435 | 436 | ||
436 | } | 437 | } |
@@ -457,8 +458,9 @@ int capi_decode_conn_ind(struct pcbit_chan * chan, | |||
457 | if (!(info->data.setup.CalledPN = kmalloc(len - count + 1, GFP_ATOMIC))) | 458 | if (!(info->data.setup.CalledPN = kmalloc(len - count + 1, GFP_ATOMIC))) |
458 | return -1; | 459 | return -1; |
459 | 460 | ||
460 | memcpy(info->data.setup.CalledPN, skb->data + count + 1, | 461 | skb_copy_from_linear_data_offset(skb, count + 1, |
461 | len - count); | 462 | info->data.setup.CalledPN, |
463 | len - count); | ||
462 | info->data.setup.CalledPN[len - count] = 0; | 464 | info->data.setup.CalledPN[len - count] = 0; |
463 | 465 | ||
464 | } | 466 | } |
@@ -539,7 +541,7 @@ int capi_decode_conn_actv_ind(struct pcbit_chan * chan, struct sk_buff *skb) | |||
539 | 541 | ||
540 | #ifdef DEBUG | 542 | #ifdef DEBUG |
541 | if (len > 1 && len < 31) { | 543 | if (len > 1 && len < 31) { |
542 | memcpy(str, skb->data + 2, len - 1); | 544 | skb_copy_from_linear_data_offset(skb, 2, str, len - 1); |
543 | str[len] = 0; | 545 | str[len] = 0; |
544 | printk(KERN_DEBUG "Connected Party Number: %s\n", str); | 546 | printk(KERN_DEBUG "Connected Party Number: %s\n", str); |
545 | } | 547 | } |