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/net/wireless/prism54 | |
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/net/wireless/prism54')
-rw-r--r-- | drivers/net/wireless/prism54/islpci_eth.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c index 6ebfff034242..7d8bff1dbc4d 100644 --- a/drivers/net/wireless/prism54/islpci_eth.c +++ b/drivers/net/wireless/prism54/islpci_eth.c | |||
@@ -162,13 +162,16 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
162 | 162 | ||
163 | skb_put(newskb, init_wds ? skb->len + 6 : skb->len); | 163 | skb_put(newskb, init_wds ? skb->len + 6 : skb->len); |
164 | if (init_wds) { | 164 | if (init_wds) { |
165 | memcpy(newskb->data + 6, skb->data, skb->len); | 165 | skb_copy_from_linear_data(skb, |
166 | newskb->data + 6, | ||
167 | skb->len); | ||
166 | memcpy(newskb->data, wds_mac, 6); | 168 | memcpy(newskb->data, wds_mac, 6); |
167 | #ifdef ISLPCI_ETH_DEBUG | 169 | #ifdef ISLPCI_ETH_DEBUG |
168 | printk("islpci_eth_transmit:wds_mac\n"); | 170 | printk("islpci_eth_transmit:wds_mac\n"); |
169 | #endif | 171 | #endif |
170 | } else | 172 | } else |
171 | memcpy(newskb->data, skb->data, skb->len); | 173 | skb_copy_from_linear_data(skb, newskb->data, |
174 | skb->len); | ||
172 | 175 | ||
173 | #if VERBOSE > SHOW_ERROR_MESSAGES | 176 | #if VERBOSE > SHOW_ERROR_MESSAGES |
174 | DEBUG(SHOW_TRACING, "memcpy %p %p %i wds %i\n", | 177 | DEBUG(SHOW_TRACING, "memcpy %p %p %i wds %i\n", |
@@ -394,8 +397,10 @@ islpci_eth_receive(islpci_private *priv) | |||
394 | /* Update spy records */ | 397 | /* Update spy records */ |
395 | wireless_spy_update(ndev, annex->addr2, &wstats); | 398 | wireless_spy_update(ndev, annex->addr2, &wstats); |
396 | 399 | ||
397 | memcpy(skb->data + sizeof (struct rfmon_header), | 400 | skb_copy_from_linear_data(skb, |
398 | skb->data, 2 * ETH_ALEN); | 401 | (skb->data + |
402 | sizeof(struct rfmon_header)), | ||
403 | 2 * ETH_ALEN); | ||
399 | skb_pull(skb, sizeof (struct rfmon_header)); | 404 | skb_pull(skb, sizeof (struct rfmon_header)); |
400 | } | 405 | } |
401 | skb->protocol = eth_type_trans(skb, ndev); | 406 | skb->protocol = eth_type_trans(skb, ndev); |