aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-27 17:55:52 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:28:23 -0400
commitd626f62b11e00c16e81e4308ab93d3f13551812a (patch)
treefac4af6ced853755e12fc709d55f0c2bec51265d /drivers/net/irda
parent2a123b86e2b242a4a6db990d2851d45e192f88e5 (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/irda')
-rw-r--r--drivers/net/irda/ali-ircc.c5
-rw-r--r--drivers/net/irda/au1k_ir.c2
-rw-r--r--drivers/net/irda/donauboe.c2
-rw-r--r--drivers/net/irda/irda-usb.c4
-rw-r--r--drivers/net/irda/mcs7780.c4
-rw-r--r--drivers/net/irda/nsc-ircc.c5
-rw-r--r--drivers/net/irda/pxaficp_ir.c2
-rw-r--r--drivers/net/irda/smsc-ircc2.c2
-rw-r--r--drivers/net/irda/via-ircc.c4
-rw-r--r--drivers/net/irda/vlsi_ir.c2
-rw-r--r--drivers/net/irda/w83977af_ir.c2
11 files changed, 16 insertions, 18 deletions
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index 0f10758226fa..fb2248a25516 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -1472,9 +1472,8 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
1472 1472
1473 self->stats.tx_bytes += skb->len; 1473 self->stats.tx_bytes += skb->len;
1474 1474
1475 memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data, 1475 skb_copy_from_linear_data(skb, self->tx_fifo.queue[self->tx_fifo.free].start,
1476 skb->len); 1476 skb->len);
1477
1478 self->tx_fifo.len++; 1477 self->tx_fifo.len++;
1479 self->tx_fifo.free++; 1478 self->tx_fifo.free++;
1480 1479
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index 27afd0f367d6..cdd1f6c1e741 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -526,7 +526,7 @@ static int au1k_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev)
526 526
527 if (aup->speed == 4000000) { 527 if (aup->speed == 4000000) {
528 /* FIR */ 528 /* FIR */
529 memcpy((void *)pDB->vaddr, skb->data, skb->len); 529 skb_copy_from_linear_data(skb, pDB->vaddr, skb->len);
530 ptxd->count_0 = skb->len & 0xff; 530 ptxd->count_0 = skb->len & 0xff;
531 ptxd->count_1 = (skb->len >> 8) & 0xff; 531 ptxd->count_1 = (skb->len >> 8) & 0xff;
532 532
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index ddfa6c38a16b..9987a0dc1eaf 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -1119,7 +1119,7 @@ dumpbufs(skb->data,skb->len,'>');
1119 else 1119 else
1120 { 1120 {
1121 len = skb->len; 1121 len = skb->len;
1122 memcpy (self->tx_bufs[self->txs], skb->data, len); 1122 skb_copy_from_linear_data(skb, self->tx_bufs[self->txs], len);
1123 } 1123 }
1124 self->ring->tx[self->txs].len = len & 0x0fff; 1124 self->ring->tx[self->txs].len = len & 0x0fff;
1125 1125
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 6ef375a095f4..0ac240ca905b 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -441,7 +441,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
441 goto drop; 441 goto drop;
442 } 442 }
443 443
444 memcpy(self->tx_buff + self->header_length, skb->data, skb->len); 444 skb_copy_from_linear_data(skb, self->tx_buff + self->header_length, skb->len);
445 445
446 /* Change setting for next frame */ 446 /* Change setting for next frame */
447 if (self->capability & IUC_STIR421X) { 447 if (self->capability & IUC_STIR421X) {
@@ -902,7 +902,7 @@ static void irda_usb_receive(struct urb *urb)
902 902
903 if(docopy) { 903 if(docopy) {
904 /* Copy packet, so we can recycle the original */ 904 /* Copy packet, so we can recycle the original */
905 memcpy(newskb->data, skb->data, urb->actual_length); 905 skb_copy_from_linear_data(skb, newskb->data, urb->actual_length);
906 /* Deliver this new skb */ 906 /* Deliver this new skb */
907 dataskb = newskb; 907 dataskb = newskb;
908 /* And hook the old skb to the URB 908 /* And hook the old skb to the URB
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c
index 3ff1f4b33c06..4b0037e498f8 100644
--- a/drivers/net/irda/mcs7780.c
+++ b/drivers/net/irda/mcs7780.c
@@ -353,7 +353,7 @@ static unsigned mcs_wrap_fir_skb(const struct sk_buff *skb, __u8 *buf)
353 buf[0] = len & 0xff; 353 buf[0] = len & 0xff;
354 buf[1] = (len >> 8) & 0xff; 354 buf[1] = (len >> 8) & 0xff;
355 /* copy the data into the tx buffer. */ 355 /* copy the data into the tx buffer. */
356 memcpy(buf+2, skb->data, skb->len); 356 skb_copy_from_linear_data(skb, buf + 2, skb->len);
357 /* put the fcs in the last four bytes in little endian order. */ 357 /* put the fcs in the last four bytes in little endian order. */
358 buf[len - 4] = fcs & 0xff; 358 buf[len - 4] = fcs & 0xff;
359 buf[len - 3] = (fcs >> 8) & 0xff; 359 buf[len - 3] = (fcs >> 8) & 0xff;
@@ -377,7 +377,7 @@ static unsigned mcs_wrap_mir_skb(const struct sk_buff *skb, __u8 *buf)
377 buf[0] = len & 0xff; 377 buf[0] = len & 0xff;
378 buf[1] = (len >> 8) & 0xff; 378 buf[1] = (len >> 8) & 0xff;
379 /* copy the data */ 379 /* copy the data */
380 memcpy(buf+2, skb->data, skb->len); 380 skb_copy_from_linear_data(skb, buf + 2, skb->len);
381 /* put the fcs in last two bytes in little endian order. */ 381 /* put the fcs in last two bytes in little endian order. */
382 buf[len - 2] = fcs & 0xff; 382 buf[len - 2] = fcs & 0xff;
383 buf[len - 1] = (fcs >> 8) & 0xff; 383 buf[len - 1] = (fcs >> 8) & 0xff;
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 8ce7dad582f4..0ff992714136 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -1466,9 +1466,8 @@ static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
1466 1466
1467 self->stats.tx_bytes += skb->len; 1467 self->stats.tx_bytes += skb->len;
1468 1468
1469 memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data, 1469 skb_copy_from_linear_data(skb, self->tx_fifo.queue[self->tx_fifo.free].start,
1470 skb->len); 1470 skb->len);
1471
1472 self->tx_fifo.len++; 1471 self->tx_fifo.len++;
1473 self->tx_fifo.free++; 1472 self->tx_fifo.free++;
1474 1473
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
index f35d7d42624e..b3e1107420af 100644
--- a/drivers/net/irda/pxaficp_ir.c
+++ b/drivers/net/irda/pxaficp_ir.c
@@ -484,7 +484,7 @@ static int pxa_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev)
484 unsigned long mtt = irda_get_mtt(skb); 484 unsigned long mtt = irda_get_mtt(skb);
485 485
486 si->dma_tx_buff_len = skb->len; 486 si->dma_tx_buff_len = skb->len;
487 memcpy(si->dma_tx_buff, skb->data, skb->len); 487 skb_copy_from_linear_data(skb, si->dma_tx_buff, skb->len);
488 488
489 if (mtt) 489 if (mtt)
490 while ((unsigned)(OSCR - si->last_oscr)/4 < mtt) 490 while ((unsigned)(OSCR - si->last_oscr)/4 < mtt)
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index e8453868d741..198bf3bfa70f 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -1162,7 +1162,7 @@ static int smsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
1162 self->new_speed = speed; 1162 self->new_speed = speed;
1163 } 1163 }
1164 1164
1165 memcpy(self->tx_buff.head, skb->data, skb->len); 1165 skb_copy_from_linear_data(skb, self->tx_buff.head, skb->len);
1166 1166
1167 self->tx_buff.len = skb->len; 1167 self->tx_buff.len = skb->len;
1168 self->tx_buff.data = self->tx_buff.head; 1168 self->tx_buff.data = self->tx_buff.head;
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index 5ff416314604..45bbd6686151 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -925,8 +925,8 @@ static int via_ircc_hard_xmit_fir(struct sk_buff *skb,
925 925
926 self->tx_fifo.tail += skb->len; 926 self->tx_fifo.tail += skb->len;
927 self->stats.tx_bytes += skb->len; 927 self->stats.tx_bytes += skb->len;
928 memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data, 928 skb_copy_from_linear_data(skb,
929 skb->len); 929 self->tx_fifo.queue[self->tx_fifo.free].start, skb->len);
930 self->tx_fifo.len++; 930 self->tx_fifo.len++;
931 self->tx_fifo.free++; 931 self->tx_fifo.free++;
932//F01 if (self->tx_fifo.len == 1) { 932//F01 if (self->tx_fifo.len == 1) {
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index 79b407f3a49a..c4be973867a6 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -993,7 +993,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
993 goto drop; 993 goto drop;
994 } 994 }
995 else 995 else
996 memcpy(rd->buf, skb->data, len); 996 skb_copy_from_linear_data(skb, rd->buf, len);
997 } 997 }
998 998
999 rd->skb = skb; /* remember skb for tx-complete stats */ 999 rd->skb = skb; /* remember skb for tx-complete stats */
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index bee445130952..0d4a68618fc1 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -529,7 +529,7 @@ int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev)
529 /* Decide if we should use PIO or DMA transfer */ 529 /* Decide if we should use PIO or DMA transfer */
530 if (self->io.speed > PIO_MAX_SPEED) { 530 if (self->io.speed > PIO_MAX_SPEED) {
531 self->tx_buff.data = self->tx_buff.head; 531 self->tx_buff.data = self->tx_buff.head;
532 memcpy(self->tx_buff.data, skb->data, skb->len); 532 skb_copy_from_linear_data(skb, self->tx_buff.data, skb->len);
533 self->tx_buff.len = skb->len; 533 self->tx_buff.len = skb->len;
534 534
535 mtt = irda_get_mtt(skb); 535 mtt = irda_get_mtt(skb);