diff options
author | Arnaldo Carvalho de Melo <acme@ghostprotocols.net> | 2007-03-31 10:55:19 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:28:29 -0400 |
commit | 27d7ff46a3498d3debc6ba68fb8014c702b81170 (patch) | |
tree | b5a0c617cf8339524d3b1f1633e08eae7b94cf86 /drivers/net/irda | |
parent | 3dbad80ac7632f243b824d469301abb97ec634a1 (diff) |
[SK_BUFF]: Introduce skb_copy_to_linear_data{_offset}
To clearly state the intent of copying to 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@ghostprotocols.net>
Diffstat (limited to 'drivers/net/irda')
-rw-r--r-- | drivers/net/irda/ali-ircc.c | 2 | ||||
-rw-r--r-- | drivers/net/irda/au1k_ir.c | 2 | ||||
-rw-r--r-- | drivers/net/irda/donauboe.c | 4 | ||||
-rw-r--r-- | drivers/net/irda/mcs7780.c | 4 | ||||
-rw-r--r-- | drivers/net/irda/nsc-ircc.c | 8 | ||||
-rw-r--r-- | drivers/net/irda/pxaficp_ir.c | 2 | ||||
-rw-r--r-- | drivers/net/irda/stir4200.c | 2 | ||||
-rw-r--r-- | drivers/net/irda/via-ircc.c | 6 | ||||
-rw-r--r-- | drivers/net/irda/w83977af_ir.c | 8 |
9 files changed, 23 insertions, 15 deletions
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c index fb2248a25516..f9c889c0dd07 100644 --- a/drivers/net/irda/ali-ircc.c +++ b/drivers/net/irda/ali-ircc.c | |||
@@ -1923,7 +1923,7 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) | |||
1923 | 1923 | ||
1924 | /* Copy frame without CRC, CRC is removed by hardware*/ | 1924 | /* Copy frame without CRC, CRC is removed by hardware*/ |
1925 | skb_put(skb, len); | 1925 | skb_put(skb, len); |
1926 | memcpy(skb->data, self->rx_buff.data, len); | 1926 | skb_copy_to_linear_data(skb, self->rx_buff.data, len); |
1927 | 1927 | ||
1928 | /* Move to next frame */ | 1928 | /* Move to next frame */ |
1929 | self->rx_buff.data += len; | 1929 | self->rx_buff.data += len; |
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c index cdd1f6c1e741..4dbdfaaf37bf 100644 --- a/drivers/net/irda/au1k_ir.c +++ b/drivers/net/irda/au1k_ir.c | |||
@@ -604,7 +604,7 @@ static int au1k_irda_rx(struct net_device *dev) | |||
604 | skb_put(skb, count); | 604 | skb_put(skb, count); |
605 | else | 605 | else |
606 | skb_put(skb, count-2); | 606 | skb_put(skb, count-2); |
607 | memcpy(skb->data, (void *)pDB->vaddr, count-2); | 607 | skb_copy_to_linear_data(skb, pDB->vaddr, count - 2); |
608 | skb->dev = dev; | 608 | skb->dev = dev; |
609 | skb_reset_mac_header(skb); | 609 | skb_reset_mac_header(skb); |
610 | skb->protocol = htons(ETH_P_IRDA); | 610 | skb->protocol = htons(ETH_P_IRDA); |
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 9987a0dc1eaf..3ca47bf6dfec 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c | |||
@@ -1282,8 +1282,8 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<'); | |||
1282 | skb_reserve (skb, 1); | 1282 | skb_reserve (skb, 1); |
1283 | 1283 | ||
1284 | skb_put (skb, len); | 1284 | skb_put (skb, len); |
1285 | memcpy (skb->data, self->rx_bufs[self->rxs], len); | 1285 | skb_copy_to_linear_data(skb, self->rx_bufs[self->rxs], |
1286 | 1286 | len); | |
1287 | self->stats.rx_packets++; | 1287 | self->stats.rx_packets++; |
1288 | skb->dev = self->netdev; | 1288 | skb->dev = self->netdev; |
1289 | skb_reset_mac_header(skb); | 1289 | skb_reset_mac_header(skb); |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index 4b0037e498f8..54d1d543c92c 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -426,7 +426,7 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len) | |||
426 | } | 426 | } |
427 | 427 | ||
428 | skb_reserve(skb, 1); | 428 | skb_reserve(skb, 1); |
429 | memcpy(skb->data, buf, new_len); | 429 | skb_copy_to_linear_data(skb, buf, new_len); |
430 | skb_put(skb, new_len); | 430 | skb_put(skb, new_len); |
431 | skb_reset_mac_header(skb); | 431 | skb_reset_mac_header(skb); |
432 | skb->protocol = htons(ETH_P_IRDA); | 432 | skb->protocol = htons(ETH_P_IRDA); |
@@ -479,7 +479,7 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len) | |||
479 | } | 479 | } |
480 | 480 | ||
481 | skb_reserve(skb, 1); | 481 | skb_reserve(skb, 1); |
482 | memcpy(skb->data, buf, new_len); | 482 | skb_copy_to_linear_data(skb, buf, new_len); |
483 | skb_put(skb, new_len); | 483 | skb_put(skb, new_len); |
484 | skb_reset_mac_header(skb); | 484 | skb_reset_mac_header(skb); |
485 | skb->protocol = htons(ETH_P_IRDA); | 485 | skb->protocol = htons(ETH_P_IRDA); |
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index 0ff992714136..d96c89751a71 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c | |||
@@ -1868,10 +1868,14 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase) | |||
1868 | /* Copy frame without CRC */ | 1868 | /* Copy frame without CRC */ |
1869 | if (self->io.speed < 4000000) { | 1869 | if (self->io.speed < 4000000) { |
1870 | skb_put(skb, len-2); | 1870 | skb_put(skb, len-2); |
1871 | memcpy(skb->data, self->rx_buff.data, len-2); | 1871 | skb_copy_to_linear_data(skb, |
1872 | self->rx_buff.data, | ||
1873 | len - 2); | ||
1872 | } else { | 1874 | } else { |
1873 | skb_put(skb, len-4); | 1875 | skb_put(skb, len-4); |
1874 | memcpy(skb->data, self->rx_buff.data, len-4); | 1876 | skb_copy_to_linear_data(skb, |
1877 | self->rx_buff.data, | ||
1878 | len - 4); | ||
1875 | } | 1879 | } |
1876 | 1880 | ||
1877 | /* Move to next frame */ | 1881 | /* Move to next frame */ |
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c index b3e1107420af..fb196fd91855 100644 --- a/drivers/net/irda/pxaficp_ir.c +++ b/drivers/net/irda/pxaficp_ir.c | |||
@@ -386,7 +386,7 @@ static void pxa_irda_fir_irq_eif(struct pxa_irda *si, struct net_device *dev, in | |||
386 | 386 | ||
387 | /* Align IP header to 20 bytes */ | 387 | /* Align IP header to 20 bytes */ |
388 | skb_reserve(skb, 1); | 388 | skb_reserve(skb, 1); |
389 | memcpy(skb->data, si->dma_rx_buff, len); | 389 | skb_copy_to_linear_data(skb, si->dma_rx_buff, len); |
390 | skb_put(skb, len); | 390 | skb_put(skb, len); |
391 | 391 | ||
392 | /* Feed it to IrLAP */ | 392 | /* Feed it to IrLAP */ |
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c index aec86a214340..755aa444a4dd 100644 --- a/drivers/net/irda/stir4200.c +++ b/drivers/net/irda/stir4200.c | |||
@@ -348,7 +348,7 @@ static void fir_eof(struct stir_cb *stir) | |||
348 | } | 348 | } |
349 | skb_reserve(nskb, 1); | 349 | skb_reserve(nskb, 1); |
350 | skb = nskb; | 350 | skb = nskb; |
351 | memcpy(nskb->data, rx_buff->data, len); | 351 | skb_copy_to_linear_data(nskb, rx_buff->data, len); |
352 | } else { | 352 | } else { |
353 | nskb = dev_alloc_skb(rx_buff->truesize); | 353 | nskb = dev_alloc_skb(rx_buff->truesize); |
354 | if (unlikely(!nskb)) { | 354 | if (unlikely(!nskb)) { |
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c index 45bbd6686151..ff5358574d0a 100644 --- a/drivers/net/irda/via-ircc.c +++ b/drivers/net/irda/via-ircc.c | |||
@@ -1189,7 +1189,7 @@ F01_E */ | |||
1189 | skb_reserve(skb, 1); | 1189 | skb_reserve(skb, 1); |
1190 | skb_put(skb, len - 4); | 1190 | skb_put(skb, len - 4); |
1191 | 1191 | ||
1192 | memcpy(skb->data, self->rx_buff.data, len - 4); | 1192 | skb_copy_to_linear_data(skb, self->rx_buff.data, len - 4); |
1193 | IRDA_DEBUG(2, "%s(): len=%x.rx_buff=%p\n", __FUNCTION__, | 1193 | IRDA_DEBUG(2, "%s(): len=%x.rx_buff=%p\n", __FUNCTION__, |
1194 | len - 4, self->rx_buff.data); | 1194 | len - 4, self->rx_buff.data); |
1195 | 1195 | ||
@@ -1234,7 +1234,7 @@ static int upload_rxdata(struct via_ircc_cb *self, int iobase) | |||
1234 | } | 1234 | } |
1235 | skb_reserve(skb, 1); | 1235 | skb_reserve(skb, 1); |
1236 | skb_put(skb, len - 4 + 1); | 1236 | skb_put(skb, len - 4 + 1); |
1237 | memcpy(skb->data, self->rx_buff.data, len - 4 + 1); | 1237 | skb_copy_to_linear_data(skb, self->rx_buff.data, len - 4 + 1); |
1238 | st_fifo->tail++; | 1238 | st_fifo->tail++; |
1239 | st_fifo->len++; | 1239 | st_fifo->len++; |
1240 | if (st_fifo->tail > MAX_RX_WINDOW) | 1240 | if (st_fifo->tail > MAX_RX_WINDOW) |
@@ -1303,7 +1303,7 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase) | |||
1303 | } | 1303 | } |
1304 | skb_reserve(skb, 1); | 1304 | skb_reserve(skb, 1); |
1305 | skb_put(skb, len - 4); | 1305 | skb_put(skb, len - 4); |
1306 | memcpy(skb->data, self->rx_buff.data, len - 4); | 1306 | skb_copy_to_linear_data(skb, self->rx_buff.data, len - 4); |
1307 | 1307 | ||
1308 | IRDA_DEBUG(2, "%s(): len=%x.head=%x\n", __FUNCTION__, | 1308 | IRDA_DEBUG(2, "%s(): len=%x.head=%x\n", __FUNCTION__, |
1309 | len - 4, st_fifo->head); | 1309 | len - 4, st_fifo->head); |
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c index 0d4a68618fc1..5182e800cc18 100644 --- a/drivers/net/irda/w83977af_ir.c +++ b/drivers/net/irda/w83977af_ir.c | |||
@@ -908,10 +908,14 @@ int w83977af_dma_receive_complete(struct w83977af_ir *self) | |||
908 | /* Copy frame without CRC */ | 908 | /* Copy frame without CRC */ |
909 | if (self->io.speed < 4000000) { | 909 | if (self->io.speed < 4000000) { |
910 | skb_put(skb, len-2); | 910 | skb_put(skb, len-2); |
911 | memcpy(skb->data, self->rx_buff.data, len-2); | 911 | skb_copy_to_linear_data(skb, |
912 | self->rx_buff.data, | ||
913 | len - 2); | ||
912 | } else { | 914 | } else { |
913 | skb_put(skb, len-4); | 915 | skb_put(skb, len-4); |
914 | memcpy(skb->data, self->rx_buff.data, len-4); | 916 | skb_copy_to_linear_data(skb, |
917 | self->rx_buff.data, | ||
918 | len - 4); | ||
915 | } | 919 | } |
916 | 920 | ||
917 | /* Move to next frame */ | 921 | /* Move to next frame */ |