[SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 27 Mar 2007 21:55:52 +0000 (18:55 -0300)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:28:23 +0000 (22:28 -0700)
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>
133 files changed:
arch/ia64/sn/kernel/xpnet.c
drivers/atm/atmtcp.c
drivers/atm/nicstar.c
drivers/bluetooth/bfusb.c
drivers/bluetooth/bpa10x.c
drivers/bluetooth/dtl1_cs.c
drivers/char/pcmcia/synclink_cs.c
drivers/infiniband/hw/cxgb3/iwch_cm.c
drivers/isdn/act2000/module.c
drivers/isdn/gigaset/usb-gigaset.c
drivers/isdn/hardware/avm/b1dma.c
drivers/isdn/hardware/avm/c4.c
drivers/isdn/hisax/elsa_ser.c
drivers/isdn/hisax/isdnl2.c
drivers/isdn/hysdn/hycapi.c
drivers/isdn/hysdn/hysdn_sched.c
drivers/isdn/i4l/isdn_common.c
drivers/isdn/i4l/isdn_ppp.c
drivers/isdn/isdnloop/isdnloop.c
drivers/isdn/pcbit/capi.c
drivers/media/dvb/dvb-core/dvb_net.c
drivers/message/fusion/mptlan.c
drivers/net/3c505.c
drivers/net/3c523.c
drivers/net/7990.c
drivers/net/a2065.c
drivers/net/arcnet/capmode.c
drivers/net/atari_bionet.c
drivers/net/atari_pamsnet.c
drivers/net/au1000_eth.c
drivers/net/b44.c
drivers/net/bnx2.c
drivers/net/cassini.c
drivers/net/chelsio/sge.c
drivers/net/cxgb3/sge.c
drivers/net/dgrs.c
drivers/net/eepro100.c
drivers/net/ehea/ehea_main.c
drivers/net/fec_8xx/fec_main.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/hamradio/dmascc.c
drivers/net/hamradio/hdlcdrv.c
drivers/net/hamradio/yam.c
drivers/net/ioc3-eth.c
drivers/net/irda/ali-ircc.c
drivers/net/irda/au1k_ir.c
drivers/net/irda/donauboe.c
drivers/net/irda/irda-usb.c
drivers/net/irda/mcs7780.c
drivers/net/irda/nsc-ircc.c
drivers/net/irda/pxaficp_ir.c
drivers/net/irda/smsc-ircc2.c
drivers/net/irda/via-ircc.c
drivers/net/irda/vlsi_ir.c
drivers/net/irda/w83977af_ir.c
drivers/net/lance.c
drivers/net/macmace.c
drivers/net/meth.c
drivers/net/myri_sbus.c
drivers/net/netxen/netxen_nic_main.c
drivers/net/ni52.c
drivers/net/ni65.c
drivers/net/pci-skeleton.c
drivers/net/pcmcia/axnet_cs.c
drivers/net/ppp_synctty.c
drivers/net/pppoe.c
drivers/net/qla3xxx.c
drivers/net/rrunner.c
drivers/net/sgiseeq.c
drivers/net/skge.c
drivers/net/sky2.c
drivers/net/sun3_82586.c
drivers/net/sun3lance.c
drivers/net/sungem.c
drivers/net/sunhme.c
drivers/net/sunlance.c
drivers/net/sunqe.c
drivers/net/tg3.c
drivers/net/tlan.c
drivers/net/tokenring/3c359.c
drivers/net/tokenring/olympic.c
drivers/net/tokenring/tms380tr.c
drivers/net/tulip/de2104x.c
drivers/net/tulip/dmfe.c
drivers/net/tulip/uli526x.c
drivers/net/tulip/xircom_cb.c
drivers/net/tulip/xircom_tulip_cb.c
drivers/net/tun.c
drivers/net/via-velocity.c
drivers/net/wan/lmc/lmc_main.c
drivers/net/wan/pc300_drv.c
drivers/net/wan/z85230.c
drivers/net/wireless/atmel.c
drivers/net/wireless/bcm43xx/bcm43xx_dma.c
drivers/net/wireless/hostap/hostap_80211_rx.c
drivers/net/wireless/hostap/hostap_80211_tx.c
drivers/net/wireless/hostap/hostap_ap.c
drivers/net/wireless/hostap/hostap_hw.c
drivers/net/wireless/ipw2100.c
drivers/net/wireless/ipw2200.c
drivers/net/wireless/prism54/islpci_eth.c
drivers/net/wireless/ray_cs.c
drivers/net/wireless/wavelan.c
drivers/net/wireless/zd1201.c
drivers/s390/net/ctcmain.c
drivers/s390/net/lcs.c
drivers/s390/net/netiucv.c
drivers/s390/net/qeth_eddp.c
drivers/usb/atm/usbatm.c
drivers/usb/net/catc.c
drivers/usb/net/pegasus.c
include/linux/skbuff.h
net/ax25/ax25_out.c
net/bluetooth/bnep/core.c
net/bluetooth/cmtp/core.c
net/bluetooth/l2cap.c
net/bridge/br_netfilter.c
net/core/skbuff.c
net/decnet/dn_nsp_in.c
net/ieee80211/ieee80211_crypt_wep.c
net/ieee80211/ieee80211_rx.c
net/ieee80211/ieee80211_tx.c
net/ipv4/ip_output.c
net/ipv6/ip6_output.c
net/irda/irttp.c
net/netrom/af_netrom.c
net/netrom/nr_loopback.c
net/netrom/nr_out.c
net/netrom/nr_subr.c
net/rose/af_rose.c
net/x25/af_x25.c
net/x25/x25_in.c
net/x25/x25_out.c

index 98d79142f32bec8544bd5927c90b3690a13a3ad0..9fc02654f0f52f4f17caad5f75c7e89669433ac6 100644 (file)
@@ -566,7 +566,8 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        msg->version = XPNET_VERSION_EMBED;
                        dev_dbg(xpnet, "calling memcpy(0x%p, 0x%p, 0x%lx)\n",
                                &msg->data, skb->data, (size_t) embedded_bytes);
-                       memcpy(&msg->data, skb->data, (size_t) embedded_bytes);
+                       skb_copy_from_linear_data(skb, &msg->data,
+                                                 (size_t)embedded_bytes);
                } else {
                        msg->version = XPNET_VERSION;
                }
index fc518d85543db88a83ba0dc31b95ae1c9af61d55..1b9493a16aca00a1487c497d2883d09cdea0e372 100644 (file)
@@ -221,7 +221,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
        hdr->vpi = htons(vcc->vpi);
        hdr->vci = htons(vcc->vci);
        hdr->length = htonl(skb->len);
-       memcpy(skb_put(new_skb,skb->len),skb->data,skb->len);
+       skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len);
        if (vcc->pop) vcc->pop(vcc,skb);
        else dev_kfree_skb(skb);
        out_vcc->push(out_vcc,new_skb);
@@ -310,7 +310,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
                goto done;
        }
        __net_timestamp(new_skb);
-       memcpy(skb_put(new_skb,skb->len),skb->data,skb->len);
+       skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len);
        out_vcc->push(out_vcc,new_skb);
        atomic_inc(&vcc->stats->tx);
        atomic_inc(&out_vcc->stats->rx);
index 26f4b7033494b7dd00933a94b539dfbafbd4c301..14ced85b3f54d9b087a5dab90dea6914cd17da9e 100644 (file)
@@ -2395,7 +2395,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
                skb->destructor = ns_lb_destructor;
 #endif /* NS_USE_DESTRUCTORS */
                skb_push(skb, NS_SMBUFSIZE);
-               memcpy(skb->data, sb->data, NS_SMBUFSIZE);
+               skb_copy_from_linear_data(sb, skb->data, NS_SMBUFSIZE);
                skb_put(skb, len - NS_SMBUFSIZE);
                ATM_SKB(skb)->vcc = vcc;
               __net_timestamp(skb);
@@ -2479,7 +2479,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
         {
             /* Copy the small buffer to the huge buffer */
             sb = (struct sk_buff *) iov->iov_base;
-            memcpy(hb->data, sb->data, iov->iov_len);
+            skb_copy_from_linear_data(sb, hb->data, iov->iov_len);
             skb_put(hb, iov->iov_len);
             remaining = len - iov->iov_len;
             iov++;
@@ -2491,7 +2491,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
             {
                lb = (struct sk_buff *) iov->iov_base;
                tocopy = min_t(int, remaining, iov->iov_len);
-               memcpy(skb_tail_pointer(hb), lb->data, tocopy);
+               skb_copy_from_linear_data(lb, skb_tail_pointer(hb), tocopy);
                skb_put(hb, tocopy);
                iov++;
                remaining -= tocopy;
index 4c766f36d8844c05cf4a07fcd198bb2ba14b0fcb..b990805806af89de1e34b258077f2af73d6b1c6a 100644 (file)
@@ -527,7 +527,7 @@ static int bfusb_send_frame(struct sk_buff *skb)
                buf[2] = (size == BFUSB_MAX_BLOCK_SIZE) ? 0 : size;
 
                memcpy(skb_put(nskb, 3), buf, 3);
-               memcpy(skb_put(nskb, size), skb->data + sent, size);
+               skb_copy_from_linear_data_offset(skb, sent, skb_put(nskb, size), size);
 
                sent  += size;
                count -= size;
index 9fca6513562d10c1f1b1e577463cb635ae639ea4..e8ebd5d3de864e4402a31dce96ec5ff7c17ffacd 100644 (file)
@@ -231,7 +231,7 @@ static void bpa10x_wakeup(struct bpa10x_data *data)
                cr = (struct usb_ctrlrequest *) urb->setup_packet;
                cr->wLength = __cpu_to_le16(skb->len);
 
-               memcpy(urb->transfer_buffer, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, urb->transfer_buffer, skb->len);
                urb->transfer_buffer_length = skb->len;
 
                err = usb_submit_urb(urb, GFP_ATOMIC);
@@ -250,7 +250,7 @@ static void bpa10x_wakeup(struct bpa10x_data *data)
                skb = skb_dequeue(&data->tx_queue);
 
        if (skb) {
-               memcpy(urb->transfer_buffer, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, urb->transfer_buffer, skb->len);
                urb->transfer_buffer_length = skb->len;
 
                err = usb_submit_urb(urb, GFP_ATOMIC);
index 459aa97937ab65e25eae168406d9782ad1b14245..7f9c54b9964a22fac39628bba97a322ffb76353a 100644 (file)
@@ -425,7 +425,7 @@ static int dtl1_hci_send_frame(struct sk_buff *skb)
                return -ENOMEM;
 
        skb_reserve(s, NSHL);
-       memcpy(skb_put(s, skb->len), skb->data, skb->len);
+       skb_copy_from_linear_data(skb, skb_put(s, skb->len), skb->len);
        if (skb->len & 0x0001)
                *skb_put(s, 1) = 0;     /* PAD */
 
index 8d025e9b5bceea3039f2c53e0dab3186e23ecebf..157b1d09ab55c2a101fbe3297513d8d8b0c77be2 100644 (file)
@@ -4169,7 +4169,7 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev)
        netif_stop_queue(dev);
 
        /* copy data to device buffers */
-       memcpy(info->tx_buf, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, info->tx_buf, skb->len);
        info->tx_get = 0;
        info->tx_put = info->tx_count = skb->len;
 
index e842c65a3f4df6130df753c77796f86805d03756..3b4b0acd707f3de691be28e5538e7cf4f6cbe8c2 100644 (file)
@@ -821,7 +821,8 @@ static void process_mpa_reply(struct iwch_ep *ep, struct sk_buff *skb)
        /*
         * copy the new data into our accumulation buffer.
         */
-       memcpy(&(ep->mpa_pkt[ep->mpa_pkt_len]), skb->data, skb->len);
+       skb_copy_from_linear_data(skb, &(ep->mpa_pkt[ep->mpa_pkt_len]),
+                                 skb->len);
        ep->mpa_pkt_len += skb->len;
 
        /*
@@ -940,7 +941,8 @@ static void process_mpa_request(struct iwch_ep *ep, struct sk_buff *skb)
        /*
         * Copy the new data into our accumulation buffer.
         */
-       memcpy(&(ep->mpa_pkt[ep->mpa_pkt_len]), skb->data, skb->len);
+       skb_copy_from_linear_data(skb, &(ep->mpa_pkt[ep->mpa_pkt_len]),
+                                 skb->len);
        ep->mpa_pkt_len += skb->len;
 
        /*
@@ -1619,7 +1621,8 @@ static int terminate(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
        PDBG("%s ep %p\n", __FUNCTION__, ep);
        skb_pull(skb, sizeof(struct cpl_rdma_terminate));
        PDBG("%s saving %d bytes of term msg\n", __FUNCTION__, skb->len);
-       memcpy(ep->com.qp->attr.terminate_buffer, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, ep->com.qp->attr.terminate_buffer,
+                                 skb->len);
        ep->com.qp->attr.terminate_msg_len = skb->len;
        ep->com.qp->attr.is_terminate_local = 0;
        return CPL_RET_BUF_DONE;
index e3e5c139907632d8417bbfbd247cbb1f431803f9..ee2b0b9f8f46b873822dc20db69f2625b9a8d650 100644 (file)
@@ -442,7 +442,7 @@ act2000_sendbuf(act2000_card *card, int channel, int ack, struct sk_buff *skb)
                        return 0;
                }
                skb_reserve(xmit_skb, 19);
-               memcpy(skb_put(xmit_skb, len), skb->data, len);
+               skb_copy_from_linear_data(skb, skb_put(xmit_skb, len), len);
        } else {
                xmit_skb = skb_clone(skb, GFP_ATOMIC);
                if (!xmit_skb) {
index 2baef349c12d149ecadbd629b3f6f0ca01ba9ab2..c8e1c357cec88870e4984233a93af30bb3bac70e 100644 (file)
@@ -652,7 +652,7 @@ static int write_modem(struct cardstate *cs)
         * transmit data
         */
        count = min(bcs->tx_skb->len, (unsigned) ucs->bulk_out_size);
-       memcpy(ucs->bulk_out_buffer, bcs->tx_skb->data, count);
+       skb_copy_from_linear_data(bcs->tx_skb, ucs->bulk_out_buffer, count);
        skb_pull(bcs->tx_skb, count);
        atomic_set(&ucs->busy, 1);
        gig_dbg(DEBUG_OUTPUT, "write_modem: send %d bytes", count);
index 1e2d38e3d68ccb3f8028b5702c1beeec36982e68..428872b653e9b0cd0c1c06d33ff7d6cf834344c6 100644 (file)
@@ -404,7 +404,8 @@ static void b1dma_dispatch_tx(avmcard *card)
                printk(KERN_DEBUG "tx: put 0x%x len=%d\n", 
                       skb->data[2], txlen);
 #endif
-               memcpy(dma->sendbuf.dmabuf, skb->data+2, skb->len-2);
+               skb_copy_from_linear_data_offset(skb, 2, dma->sendbuf.dmabuf,
+                                                skb->len - 2);
        }
        txlen = (txlen + 3) & ~3;
 
index 6f5efa8d78cb24a1a31e5eb117ea5c9b01eeeb80..d58f927e766a4a95f9c942be039e6ae3071be210 100644 (file)
@@ -457,7 +457,8 @@ static void c4_dispatch_tx(avmcard *card)
                printk(KERN_DEBUG "%s: tx put 0x%x len=%d\n",
                                card->name, skb->data[2], txlen);
 #endif
-               memcpy(dma->sendbuf.dmabuf, skb->data+2, skb->len-2);
+               skb_copy_from_linear_data_offset(skb, 2, dma->sendbuf.dmabuf,
+                                                skb->len - 2);
        }
        txlen = (txlen + 3) & ~3;
 
index ae377e812775a4085f033a46a1ff70a6846d61c7..1642dca988a1e74bc8a3884fd5817128b0bfed41 100644 (file)
@@ -254,14 +254,16 @@ write_modem(struct BCState *bcs) {
        count = len;
        if (count > MAX_MODEM_BUF - fp) {
                count = MAX_MODEM_BUF - fp;
-               memcpy(cs->hw.elsa.transbuf + fp, bcs->tx_skb->data, count);
+               skb_copy_from_linear_data(bcs->tx_skb,
+                                         cs->hw.elsa.transbuf + fp, count);
                skb_pull(bcs->tx_skb, count);
                cs->hw.elsa.transcnt += count;
                ret = count;
                count = len - count;
                fp = 0;
        }
-       memcpy((cs->hw.elsa.transbuf + fp), bcs->tx_skb->data, count);
+       skb_copy_from_linear_data(bcs->tx_skb,
+                                 cs->hw.elsa.transbuf + fp, count);
        skb_pull(bcs->tx_skb, count);
        cs->hw.elsa.transcnt += count;
        ret += count;
index cd3b5ad534914cd1409d5b62ed28169d61d0677a..3446f249d675fb7e205dd96697c9022b3c100c00 100644 (file)
@@ -1293,7 +1293,8 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
                oskb = skb;
                skb = alloc_skb(oskb->len + i, GFP_ATOMIC);
                memcpy(skb_put(skb, i), header, i);
-               memcpy(skb_put(skb, oskb->len), oskb->data, oskb->len);
+               skb_copy_from_linear_data(oskb,
+                                         skb_put(skb, oskb->len), oskb->len);
                dev_kfree_skb(oskb);
        }
        st->l2.l2l1(st, PH_PULL | INDICATION, skb);
index b2ae4ec1e49e1c1566b4bd5b723608d81c3a361a..4433ce0fca556a9b502c9863aa84202ec446eb32 100644 (file)
@@ -398,7 +398,7 @@ static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
                        _len = CAPIMSG_LEN(skb->data);
                        if (_len > 22) {
                                _len2 = _len - 22;
-                               memcpy(msghead, skb->data, 22);
+                               skb_copy_from_linear_data(skb, msghead, 22);
                                memcpy(skb->data + _len2, msghead, 22);
                                skb_pull(skb, _len2);
                                CAPIMSG_SETLEN(skb->data, 22);
index b7b5aa4748a0984ee46471e9cf707143c8c32593..81db4a190d410360e9544bb752bef801515898ad 100644 (file)
@@ -113,7 +113,8 @@ hysdn_sched_tx(hysdn_card *card, unsigned char *buf,
            (skb = hysdn_tx_netget(card)) != NULL) 
        {
                if (skb->len <= maxlen) {
-                       memcpy(buf, skb->data, skb->len);       /* copy the packet to the buffer */
+                       /* copy the packet to the buffer */
+                       skb_copy_from_linear_data(skb, buf, skb->len);
                        *len = skb->len;
                        *chan = CHAN_NDIS_DATA;
                        card->net_tx_busy = 1;  /* we are busy sending network data */
@@ -126,7 +127,7 @@ hysdn_sched_tx(hysdn_card *card, unsigned char *buf,
            ((skb = hycapi_tx_capiget(card)) != NULL) )
        {
                if (skb->len <= maxlen) {
-                       memcpy(buf, skb->data, skb->len);
+                       skb_copy_from_linear_data(skb, buf, skb->len);
                        *len = skb->len;
                        *chan = CHAN_CAPI;
                        hycapi_tx_capiack(card);
index 9c926e41b1140fc463ca448960a7bec233b14f70..c97330b198772cb290ee768556949a5460cd36a6 100644 (file)
@@ -829,7 +829,7 @@ isdn_readbchan(int di, int channel, u_char * buf, u_char * fp, int len, wait_que
                                dflag = 0;
                        }
                        count_put = count_pull;
-                       memcpy(cp, skb->data, count_put);
+                       skb_copy_from_linear_data(skb, cp, count_put);
                        cp += count_put;
                        len -= count_put;
 #ifdef CONFIG_ISDN_AUDIO
index be915051cb2e2e4cd9bd1d815aec7b68663b35dd..387392cb3d6804fabbf28b713f2a4ac009e81b97 100644 (file)
@@ -1100,7 +1100,8 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
                                        goto drop_packet;
                                }
                                skb_put(skb, skb_old->len + 128);
-                               memcpy(skb->data, skb_old->data, skb_old->len);
+                               skb_copy_from_linear_data(skb_old, skb->data,
+                                                         skb_old->len);
                                if (net_dev->local->ppp_slot < 0) {
                                        printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
                                                __FUNCTION__, net_dev->local->ppp_slot);
@@ -1902,7 +1903,9 @@ void isdn_ppp_mp_reassembly( isdn_net_dev * net_dev, isdn_net_local * lp,
                while( from != to ) {
                        unsigned int len = from->len - MP_HEADER_LEN;
 
-                       memcpy(skb_put(skb,len), from->data+MP_HEADER_LEN, len);
+                       skb_copy_from_linear_data_offset(from, MP_HEADER_LEN,
+                                                        skb_put(skb,len),
+                                                        len);
                        frag = from->next;
                        isdn_ppp_mp_free_skb(mp, from);
                        from = frag; 
index e3add27dd0e1926c1f70cbb114e08ae06dc6e1d4..e93ad59f60bf9020bb4772fd95d75922d2e29e7d 100644 (file)
@@ -415,7 +415,8 @@ isdnloop_sendbuf(int channel, struct sk_buff *skb, isdnloop_card * card)
                spin_lock_irqsave(&card->isdnloop_lock, flags);
                nskb = dev_alloc_skb(skb->len);
                if (nskb) {
-                       memcpy(skb_put(nskb, len), skb->data, len);
+                       skb_copy_from_linear_data(skb,
+                                                 skb_put(nskb, len), len);
                        skb_queue_tail(&card->bqueue[channel], nskb);
                        dev_kfree_skb(skb);
                } else
index 47c59e95898d8be074a30bdc9535100073bfd96d..7b55e151f1b009fb78f402680dbf75849db10d8c 100644 (file)
@@ -429,8 +429,9 @@ int capi_decode_conn_ind(struct pcbit_chan * chan,
                if (!(info->data.setup.CallingPN = kmalloc(len - count + 1, GFP_ATOMIC)))
                        return -1;
        
-               memcpy(info->data.setup.CallingPN, skb->data + count + 1, 
-                      len - count);
+               skb_copy_from_linear_data_offset(skb, count + 1,
+                                                info->data.setup.CallingPN,
+                                                len - count);
                info->data.setup.CallingPN[len - count] = 0;
 
        }
@@ -457,8 +458,9 @@ int capi_decode_conn_ind(struct pcbit_chan * chan,
                if (!(info->data.setup.CalledPN = kmalloc(len - count + 1, GFP_ATOMIC)))
                        return -1;
         
-               memcpy(info->data.setup.CalledPN, skb->data + count + 1, 
-                      len - count); 
+               skb_copy_from_linear_data_offset(skb, count + 1,
+                                                info->data.setup.CalledPN,
+                                                len - count);
                info->data.setup.CalledPN[len - count] = 0;
 
        }
@@ -539,7 +541,7 @@ int capi_decode_conn_actv_ind(struct pcbit_chan * chan, struct sk_buff *skb)
 
 #ifdef DEBUG
        if (len > 1 && len < 31) {
-               memcpy(str, skb->data + 2, len - 1);
+               skb_copy_from_linear_data_offset(skb, 2, str, len - 1);
                str[len] = 0;
                printk(KERN_DEBUG "Connected Party Number: %s\n", str);
        }
index 9de177a5b9f1ba615d8d478c90540134ac8d9d11..6a5ab409c4e71919b5331339adc51ed9b3b4fa0c 100644 (file)
@@ -697,7 +697,9 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
                                        }
                                        else
                                        {
-                                               memcpy(dest_addr,  priv->ule_skb->data, ETH_ALEN);
+                                               skb_copy_from_linear_data(priv->ule_skb,
+                                                             dest_addr,
+                                                             ETH_ALEN);
                                                skb_pull(priv->ule_skb, ETH_ALEN);
                                        }
                                }
index 21fe1b66808c03f5e85d504610279b7c8dc80f28..7dd34bd28efc8f63d3a856c8b1d3a155c4aea744 100644 (file)
@@ -932,7 +932,7 @@ mpt_lan_receive_post_turbo(struct net_device *dev, u32 tmsg)
                pci_dma_sync_single_for_cpu(mpt_dev->pcidev, priv->RcvCtl[ctx].dma,
                                            priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE);
 
-               memcpy(skb_put(skb, len), old_skb->data, len);
+               skb_copy_from_linear_data(old_skb, skb_put(skb, len), len);
 
                pci_dma_sync_single_for_device(mpt_dev->pcidev, priv->RcvCtl[ctx].dma,
                                               priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE);
@@ -1093,7 +1093,7 @@ mpt_lan_receive_post_reply(struct net_device *dev,
                                                    priv->RcvCtl[ctx].dma,
                                                    priv->RcvCtl[ctx].len,
                                                    PCI_DMA_FROMDEVICE);
-                       memcpy(skb_put(skb, l), old_skb->data, l);
+                       skb_copy_from_linear_data(old_skb, skb_put(skb, l), l);
 
                        pci_dma_sync_single_for_device(mpt_dev->pcidev,
                                                       priv->RcvCtl[ctx].dma,
@@ -1122,7 +1122,7 @@ mpt_lan_receive_post_reply(struct net_device *dev,
                                            priv->RcvCtl[ctx].len,
                                            PCI_DMA_FROMDEVICE);
 
-               memcpy(skb_put(skb, len), old_skb->data, len);
+               skb_copy_from_linear_data(old_skb, skb_put(skb, len), len);
 
                pci_dma_sync_single_for_device(mpt_dev->pcidev,
                                               priv->RcvCtl[ctx].dma,
index c693b5a795000e742ba05d7f9b34184d20f2b087..e985a85a56237b6bccb13ac689a92e061ff418d1 100644 (file)
@@ -1025,7 +1025,7 @@ static int send_packet(struct net_device *dev, struct sk_buff *skb)
        adapter->current_dma.start_time = jiffies;
 
        if ((unsigned long)(skb->data + nlen) >= MAX_DMA_ADDRESS || nlen != skb->len) {
-               memcpy(adapter->dma_buffer, skb->data, nlen);
+               skb_copy_from_linear_data(skb, adapter->dma_buffer, nlen);
                memset(adapter->dma_buffer+skb->len, 0, nlen-skb->len);
                target = isa_virt_to_bus(adapter->dma_buffer);
        }
index 6b2036df68568ccc8a478dce3ef118073b9d8ea8..a384f7d478abc912abe9cf86fb6657dcce589dcd 100644 (file)
@@ -1145,7 +1145,7 @@ static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev)
 
        if (len != skb->len)
                memset((char *) p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN);
-       memcpy((char *) p->xmit_cbuffs[p->xmit_count], (char *) (skb->data), skb->len);
+       skb_copy_from_linear_data(skb, p->xmit_cbuffs[p->xmit_count], skb->len);
 
 #if (NUM_XMIT_BUFFS == 1)
 #ifdef NO_NOPCOMMANDS
index c50264aea16b41ed4c6d85b7cc3cff5329bdf40c..d396f996af5722c54d7159b4e3b33edc36630d48 100644 (file)
@@ -567,7 +567,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
 
        if (skb->len < ETH_ZLEN)
                memset((char *)&ib->tx_buf[entry][0], 0, ETH_ZLEN);
-        memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen);
+        skb_copy_from_linear_data(skb, &ib->tx_buf[entry][0], skblen);
 
         /* Now, give the packet to the lance */
         ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN);
index b38fc65005eb0079193cea42f84af49c2642d53a..1226cbba0450dd477bc90475a77f49955026f344 100644 (file)
@@ -598,7 +598,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
        ib->btx_ring [entry].length = (-len) | 0xf000;
        ib->btx_ring [entry].misc = 0;
 
-       memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen);
+       skb_copy_from_linear_data(skb, &ib->tx_buf [entry][0], skblen);
 
        /* Clear the slack of the packet, do I need this? */
        if (len != skblen)
index f6a87bd20ff2a15750d8673bc24427f95cbd4194..cc4610db6395f9e743e16ff374fd88f860d5dbe2 100644 (file)
@@ -273,7 +273,8 @@ static int ack_tx(struct net_device *dev, int acked)
   /* skb_pull(ackskb, ARC_HDR_SIZE); */
 
 
-  memcpy(ackpkt, lp->outgoing.skb->data, ARC_HDR_SIZE+sizeof(struct arc_cap));
+  skb_copy_from_linear_data(lp->outgoing.skb, ackpkt,
+               ARC_HDR_SIZE + sizeof(struct arc_cap));
   ackpkt->soft.cap.proto=0; /* using protocol 0 for acknowledge */
   ackpkt->soft.cap.mes.ack=acked;
 
index f52e7f22f63d9d5f470d01735873b44043b557df..13dbed368d6a5018c0feff4829c0a873f77b0108 100644 (file)
@@ -453,7 +453,8 @@ bionet_send_packet(struct sk_buff *skb, struct net_device *dev) {
                stdma_lock(bionet_intr, NULL);
                local_irq_restore(flags);
                if( !STRAM_ADDR(buf+length-1) ) {
-                       memcpy(nic_packet->buffer, skb->data, length);
+                       skb_copy_from_linear_data(skb, nic_packet->buffer,
+                                                 length);
                        buf = (unsigned long)&((struct nic_pkt_s *)phys_nic_packet)->buffer;
                }
 
index 3b543614928606cae76a4bcfc7a661723c1f6668..745101d7451b25bc7fc4adfd628d6febc54be17b 100644 (file)
@@ -717,7 +717,8 @@ pamsnet_send_packet(struct sk_buff *skb, struct net_device *dev) {
 
                local_irq_restore(flags);
                if( !STRAM_ADDR(buf+length-1) ) {
-                       memcpy(nic_packet->buffer, skb->data, length);
+                       skb_copy_from_linear_data(skb, nic_packet->buffer,
+                                                 length);
                        buf = (unsigned long)phys_nic_packet;
                }
 
index 97b55f2546c5d6351e22869bb1360ea46123fa96..d10fb80e9a6302a83f6830b73ae01057102328e7 100644 (file)
@@ -1125,7 +1125,7 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
        }
 
        pDB = aup->tx_db_inuse[aup->tx_head];
-       memcpy((void *)pDB->vaddr, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, pDB->vaddr, skb->len);
        if (skb->len < ETH_ZLEN) {
                for (i=skb->len; i<ETH_ZLEN; i++) {
                        ((char *)pDB->vaddr)[i] = 0;
index f67d97de97ff59b8a8ee362d3d4a13aea82ee747..879a2fff474e007f62907e642d1ea9fdab2ec04b 100644 (file)
@@ -828,8 +828,8 @@ static int b44_rx(struct b44 *bp, int budget)
                        skb_reserve(copy_skb, 2);
                        skb_put(copy_skb, len);
                        /* DMA sync done above, copy just the actual packet */
-                       memcpy(copy_skb->data, skb->data+bp->rx_offset, len);
-
+                       skb_copy_from_linear_data_offset(skb, bp->rx_offset,
+                                                        copy_skb->data, len);
                        skb = copy_skb;
                }
                skb->ip_summed = CHECKSUM_NONE;
@@ -1006,7 +1006,8 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        goto err_out;
                }
 
-               memcpy(skb_put(bounce_skb, len), skb->data, skb->len);
+               skb_copy_from_linear_data(skb, skb_put(bounce_skb, len),
+                                         skb->len);
                dev_kfree_skb_any(skb);
                skb = bounce_skb;
        }
index 7e7b5f344030251a47fc0dd150eb1712c2408e4e..f98a2205a09035cc0741ea049eed5615fd873cdf 100644 (file)
@@ -1884,10 +1884,8 @@ bnx2_rx_int(struct bnx2 *bp, int budget)
                                goto reuse_rx;
 
                        /* aligned copy */
-                       memcpy(new_skb->data,
-                               skb->data + bp->rx_offset - 2,
-                               len + 2);
-
+                       skb_copy_from_linear_data_offset(skb, bp->rx_offset - 2,
+                                     new_skb->data, len + 2);
                        skb_reserve(new_skb, 2);
                        skb_put(new_skb, len);
 
index bd3ab6493e393cad862e1b1da34c3d9b8b13e0ab..4aec747d9e437a819f6e0127598a35a4f373a88d 100644 (file)
@@ -2846,8 +2846,8 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
                              ctrl | TX_DESC_SOF, 0);
                entry = TX_DESC_NEXT(ring, entry);
 
-               memcpy(tx_tiny_buf(cp, ring, entry), skb->data +
-                      len - tabort, tabort);
+               skb_copy_from_linear_data_offset(skb, len - tabort,
+                             tx_tiny_buf(cp, ring, entry), tabort);
                mapping = tx_tiny_map(cp, ring, entry, tentry);
                cas_write_txd(cp, ring, entry, mapping, tabort, ctrl,
                              (nr_frags == 0));
index 43e92f9f0bcddeae561ca2935bd00f019a3c421d..1be1bbd1616480652f9a45eef1f7da2ac7599c8b 100644 (file)
@@ -1062,7 +1062,7 @@ static inline struct sk_buff *get_packet(struct pci_dev *pdev,
                                            pci_unmap_addr(ce, dma_addr),
                                            pci_unmap_len(ce, dma_len),
                                            PCI_DMA_FROMDEVICE);
-               memcpy(skb->data, ce->skb->data, len);
+               skb_copy_from_linear_data(ce->skb, skb->data, len);
                pci_dma_sync_single_for_device(pdev,
                                               pci_unmap_addr(ce, dma_addr),
                                               pci_unmap_len(ce, dma_len),
index c5faf1380e15c8a0214e0592f1fbde47947f5fc0..166c959c94b9c40cecf956fee996777d218fac86 100644 (file)
@@ -913,7 +913,8 @@ static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *skb,
                if (skb->len <= WR_LEN - sizeof(*cpl)) {
                        q->sdesc[pidx].skb = NULL;
                        if (!skb->data_len)
-                               memcpy(&d->flit[2], skb->data, skb->len);
+                               skb_copy_from_linear_data(skb, &d->flit[2],
+                                                         skb->len);
                        else
                                skb_copy_bits(skb, 0, &d->flit[2], skb->len);
 
@@ -1771,7 +1772,7 @@ static struct sk_buff *get_packet(struct adapter *adap, struct sge_fl *fl,
                        __skb_put(skb, len);
                        pci_dma_sync_single_for_cpu(adap->pdev, mapping, len,
                                                    PCI_DMA_FROMDEVICE);
-                       memcpy(skb->data, sd->t.skb->data, len);
+                       skb_copy_from_linear_data(sd->t.skb, skb->data, len);
                        pci_dma_sync_single_for_device(adap->pdev, mapping, len,
                                                       PCI_DMA_FROMDEVICE);
                } else if (!drop_thres)
index d223c38966f4ef7ab8e8f8972c9a4b7382567fbb..df62c0232f369e431876a2da16b50fafbb2d7d43 100644 (file)
@@ -741,7 +741,7 @@ static int dgrs_start_xmit(struct sk_buff *skb, struct net_device *devN)
                }
 
                amt = min_t(unsigned int, len, rbdp->size - count);
-               memcpy( (char *) S2H(rbdp->buf) + count, skb->data + i, amt);
+               skb_copy_from_linear_data_offset(skb, i, S2H(rbdp->buf) + count, amt);
                i += amt;
                count += amt;
                len -= amt;
index db658bc491a9c5ddd6c29b97689d14a24267a94f..6c267c38df97a7080b2094ce08b31da4cdaaadc4 100644 (file)
@@ -1804,8 +1804,9 @@ speedo_rx(struct net_device *dev)
                                eth_copy_and_sum(skb, sp->rx_skbuff[entry]->data, pkt_len, 0);
                                skb_put(skb, pkt_len);
 #else
-                               memcpy(skb_put(skb, pkt_len), sp->rx_skbuff[entry]->data,
-                                          pkt_len);
+                               skb_copy_from_linear_data(sp->rx_skbuff[entry],
+                                                         skb_put(skb, pkt_len),
+                                                         pkt_len);
 #endif
                                pci_dma_sync_single_for_device(sp->pdev, sp->rx_ring_dma[entry],
                                                                                           sizeof(struct RxFD) + pkt_len,
index 63732d2305bbcf9590cf3a141046783f03690293..8b53920726327cc9bfb68371fa6a37ae903c66c3 100644 (file)
@@ -1306,7 +1306,7 @@ static void write_swqe2_TSO(struct sk_buff *skb,
 
        if (skb_data_size >= headersize) {
                /* copy immediate data */
-               memcpy(imm_data, skb->data, headersize);
+               skb_copy_from_linear_data(skb, imm_data, headersize);
                swqe->immediate_data_length = headersize;
 
                if (skb_data_size > headersize) {
@@ -1337,7 +1337,7 @@ static void write_swqe2_nonTSO(struct sk_buff *skb,
         */
        if (skb_data_size >= SWQE2_MAX_IMM) {
                /* copy immediate data */
-               memcpy(imm_data, skb->data, SWQE2_MAX_IMM);
+               skb_copy_from_linear_data(skb, imm_data, SWQE2_MAX_IMM);
 
                swqe->immediate_data_length = SWQE2_MAX_IMM;
 
@@ -1350,7 +1350,7 @@ static void write_swqe2_nonTSO(struct sk_buff *skb,
                        swqe->descriptors++;
                }
        } else {
-               memcpy(imm_data, skb->data, skb_data_size);
+               skb_copy_from_linear_data(skb, imm_data, skb_data_size);
                swqe->immediate_data_length = skb_data_size;
        }
 }
@@ -1772,10 +1772,11 @@ static void ehea_xmit3(struct sk_buff *skb, struct net_device *dev,
        /* copy (immediate) data */
        if (nfrags == 0) {
                /* data is in a single piece */
-               memcpy(imm_data, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, imm_data, skb->len);
        } else {
                /* first copy data from the skb->data buffer ... */
-               memcpy(imm_data, skb->data, skb->len - skb->data_len);
+               skb_copy_from_linear_data(skb, imm_data,
+                                         skb->len - skb->data_len);
                imm_data += skb->len - skb->data_len;
 
                /* ... then copy data from the fragments */
index 698dba8f2aa1bb22189c171a90c9a972cbc249bf..e824d5d231afbe6b0341bc0af099642262b4b29b 100644 (file)
@@ -551,7 +551,9 @@ static int fec_enet_rx_common(struct net_device *dev, int *budget)
                                skbn = dev_alloc_skb(pkt_len + 2);
                                if (skbn != NULL) {
                                        skb_reserve(skbn, 2);   /* align IP header */
-                                       memcpy(skbn->data, skb->data, pkt_len);
+                                       skb_copy_from_linear_data(skb
+                                                                 skbn->data,
+                                                                 pkt_len);
                                        /* swap */
                                        skbt = skb;
                                        skb = skbn;
index 9f6ef315ce51b868e45f7a6f68dcd04d3c352509..e2ddd617493a398dff4446614cbd222c7bbed733 100644 (file)
@@ -160,7 +160,8 @@ static int fs_enet_rx_napi(struct net_device *dev, int *budget)
                                skbn = dev_alloc_skb(pkt_len + 2);
                                if (skbn != NULL) {
                                        skb_reserve(skbn, 2);   /* align IP header */
-                                       memcpy(skbn->data, skb->data, pkt_len);
+                                       skb_copy_from_linear_data(skb,
+                                                     skbn->data, pkt_len);
                                        /* swap */
                                        skbt = skb;
                                        skb = skbn;
@@ -293,7 +294,8 @@ static int fs_enet_rx_non_napi(struct net_device *dev)
                                skbn = dev_alloc_skb(pkt_len + 2);
                                if (skbn != NULL) {
                                        skb_reserve(skbn, 2);   /* align IP header */
-                                       memcpy(skbn->data, skb->data, pkt_len);
+                                       skb_copy_from_linear_data(skb,
+                                                     skbn->data, pkt_len);
                                        /* swap */
                                        skbt = skb;
                                        skb = skbn;
index 0fbb414b5a4ddba69f5a93be26148ea578f5fb1b..3be8c5047599f5bc0029842eeb072f2593745f5b 100644 (file)
@@ -930,7 +930,7 @@ static int scc_send_packet(struct sk_buff *skb, struct net_device *dev)
 
        /* Transfer data to DMA buffer */
        i = priv->tx_head;
-       memcpy(priv->tx_buf[i], skb->data + 1, skb->len - 1);
+       skb_copy_from_linear_data_offset(skb, 1, priv->tx_buf[i], skb->len - 1);
        priv->tx_len[i] = skb->len - 1;
 
        /* Clear interrupts while we touch our circular buffers */
index f5a17ad9d3d66850abd57373d0b36f51845dfe04..b33adc6a340b055ad8b1a2076331f5697f83a517 100644 (file)
@@ -317,7 +317,9 @@ void hdlcdrv_transmitter(struct net_device *dev, struct hdlcdrv_state *s)
                                dev_kfree_skb_irq(skb);
                                break;
                        }
-                       memcpy(s->hdlctx.buffer, skb->data+1, pkt_len);
+                       skb_copy_from_linear_data_offset(skb, 1,
+                                                        s->hdlctx.buffer,
+                                                        pkt_len);
                        dev_kfree_skb_irq(skb);
                        s->hdlctx.bp = s->hdlctx.buffer;
                        append_crc_ccitt(s->hdlctx.buffer, pkt_len);
index ee3ea4fa729f370a79567dbb3432f2d5b3d37b10..ac2d6dd9dbe4ca18ff38ee3e4b4fa3d84db7d586 100644 (file)
@@ -638,7 +638,9 @@ static void yam_tx_byte(struct net_device *dev, struct yam_port *yp)
                                dev_kfree_skb_any(skb);
                                break;
                        }
-                       memcpy(yp->tx_buf, skb->data + 1, yp->tx_len);
+                       skb_copy_from_linear_data_offset(skb->data, 1,
+                                                        yp->tx_buf,
+                                                        yp->tx_len);
                        dev_kfree_skb_any(skb);
                        yp->tx_count = 0;
                        yp->tx_crcl = 0x21;
index bc62e770a256cb2c728ec8fe839115c1775404fd..f749e07c642524b9e8a5249c852c831798f7f304 100644 (file)
@@ -1443,7 +1443,7 @@ static int ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        if (len <= 104) {
                /* Short packet, let's copy it directly into the ring.  */
-               memcpy(desc->data, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, desc->data, skb->len);
                if (len < ETH_ZLEN) {
                        /* Very short packet, pad with zeros at the end. */
                        memset(desc->data + len, 0, ETH_ZLEN - len);
index 0f10758226fac369c1658fe2b6239d6262b8c89a..fb2248a255166d8f15a535349d6c4b441572eddc 100644 (file)
@@ -1472,9 +1472,8 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
 
        self->stats.tx_bytes += skb->len;
 
-       memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data, 
-              skb->len);
-       
+       skb_copy_from_linear_data(skb, self->tx_fifo.queue[self->tx_fifo.free].start,
+                     skb->len);
        self->tx_fifo.len++;
        self->tx_fifo.free++;
 
index 27afd0f367d644da22f626f9b6f6ce4b54728bbf..cdd1f6c1e7411b9fa3f252ec4193c6e88ba01d85 100644 (file)
@@ -526,7 +526,7 @@ static int au1k_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev)
        
        if (aup->speed == 4000000) {
                /* FIR */
-               memcpy((void *)pDB->vaddr, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, pDB->vaddr, skb->len);
                ptxd->count_0 = skb->len & 0xff;
                ptxd->count_1 = (skb->len >> 8) & 0xff;
 
index ddfa6c38a16bc6aba1e447a59ceafff0b9403928..9987a0dc1eaf53e475808cae9ae7e95e6104d03e 100644 (file)
@@ -1119,7 +1119,7 @@ dumpbufs(skb->data,skb->len,'>');
   else
     {
       len = skb->len;
-      memcpy (self->tx_bufs[self->txs], skb->data, len);
+      skb_copy_from_linear_data(skb, self->tx_bufs[self->txs], len);
     }
   self->ring->tx[self->txs].len = len & 0x0fff;
 
index 6ef375a095f418913c625453906b4f04399881f4..0ac240ca905b8504d7a9524e532c0a6f5e504608 100644 (file)
@@ -441,7 +441,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
                goto drop;
        }
 
-       memcpy(self->tx_buff + self->header_length, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, self->tx_buff + self->header_length, skb->len);
 
        /* Change setting for next frame */
        if (self->capability & IUC_STIR421X) {
@@ -902,7 +902,7 @@ static void irda_usb_receive(struct urb *urb)
 
        if(docopy) {
                /* Copy packet, so we can recycle the original */
-               memcpy(newskb->data, skb->data, urb->actual_length);
+               skb_copy_from_linear_data(skb, newskb->data, urb->actual_length);
                /* Deliver this new skb */
                dataskb = newskb;
                /* And hook the old skb to the URB
index 3ff1f4b33c06660c600f348129d8588ec412283b..4b0037e498f8775db1c325eb1bfbe7176caf25e4 100644 (file)
@@ -353,7 +353,7 @@ static unsigned mcs_wrap_fir_skb(const struct sk_buff *skb, __u8 *buf)
        buf[0] = len & 0xff;
        buf[1] = (len >> 8) & 0xff;
        /* copy the data into the tx buffer. */
-       memcpy(buf+2, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, buf + 2, skb->len);
        /* put the fcs in the last four bytes in little endian order. */
        buf[len - 4] = fcs & 0xff;
        buf[len - 3] = (fcs >> 8) & 0xff;
@@ -377,7 +377,7 @@ static unsigned mcs_wrap_mir_skb(const struct sk_buff *skb, __u8 *buf)
        buf[0] = len & 0xff;
        buf[1] = (len >> 8) & 0xff;
        /* copy the data */
-       memcpy(buf+2, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, buf + 2, skb->len);
        /* put the fcs in last two bytes in little endian order. */
        buf[len - 2] = fcs & 0xff;
        buf[len - 1] = (fcs >> 8) & 0xff;
index 8ce7dad582f4aad0349967c29169463a63d802a3..0ff992714136f86de65227fc5686991030108c4e 100644 (file)
@@ -1466,9 +1466,8 @@ static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
 
        self->stats.tx_bytes += skb->len;
 
-       memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data, 
-              skb->len);
-       
+       skb_copy_from_linear_data(skb, self->tx_fifo.queue[self->tx_fifo.free].start,
+                     skb->len);
        self->tx_fifo.len++;
        self->tx_fifo.free++;
 
index f35d7d42624e8bc67091b359db7619bec106e8d8..b3e1107420aff55bd379cd50f67805478c8275d1 100644 (file)
@@ -484,7 +484,7 @@ static int pxa_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev)
                unsigned long mtt = irda_get_mtt(skb);
 
                si->dma_tx_buff_len = skb->len;
-               memcpy(si->dma_tx_buff, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, si->dma_tx_buff, skb->len);
 
                if (mtt)
                        while ((unsigned)(OSCR - si->last_oscr)/4 < mtt)
index e8453868d741044ceb6447d1dfe82d721bdb8a0e..198bf3bfa70fc234b3ba4b4d0f182dac0280572c 100644 (file)
@@ -1162,7 +1162,7 @@ static int smsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
                self->new_speed = speed;
        }
 
-       memcpy(self->tx_buff.head, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, self->tx_buff.head, skb->len);
 
        self->tx_buff.len = skb->len;
        self->tx_buff.data = self->tx_buff.head;
index 5ff416314604d22d882595a0cab0607a0f645deb..45bbd66861512dda1c246a44229d3ab27855b062 100644 (file)
@@ -925,8 +925,8 @@ static int via_ircc_hard_xmit_fir(struct sk_buff *skb,
 
        self->tx_fifo.tail += skb->len;
        self->stats.tx_bytes += skb->len;
-       memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data,
-              skb->len);
+       skb_copy_from_linear_data(skb,
+                     self->tx_fifo.queue[self->tx_fifo.free].start, skb->len);
        self->tx_fifo.len++;
        self->tx_fifo.free++;
 //F01   if (self->tx_fifo.len == 1) {
index 79b407f3a49a5411077246f9eb2975c0d6d1fe1d..c4be973867a6904713ce108baee9516580551acd 100644 (file)
@@ -993,7 +993,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
                        goto drop;
                }
                else
-                       memcpy(rd->buf, skb->data, len);
+                       skb_copy_from_linear_data(skb, rd->buf, len);
        }
 
        rd->skb = skb;                  /* remember skb for tx-complete stats */
index bee4451309524779c602847baab75ab75e2b9039..0d4a68618fc19e74a187c422bd466d804d96be2a 100644 (file)
@@ -529,7 +529,7 @@ int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Decide if we should use PIO or DMA transfer */
        if (self->io.speed > PIO_MAX_SPEED) {
                self->tx_buff.data = self->tx_buff.head;
-               memcpy(self->tx_buff.data, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, self->tx_buff.data, skb->len);
                self->tx_buff.len = skb->len;
                
                mtt = irda_get_mtt(skb);
index 11cbcb946db407dedd97cfa5825fd80862a71c78..0fe96c85828b0b997014904c23b737c56e574bec 100644 (file)
@@ -988,7 +988,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
                if (lance_debug > 5)
                        printk("%s: bouncing a high-memory packet (%#x).\n",
                                   dev->name, (u32)isa_virt_to_bus(skb->data));
-               memcpy(&lp->tx_bounce_buffs[entry], skb->data, skb->len);
+               skb_copy_from_linear_data(skb, &lp->tx_bounce_buffs[entry], skb->len);
                lp->tx_ring[entry].base =
                        ((u32)isa_virt_to_bus((lp->tx_bounce_buffs + entry)) & 0xffffff) | 0x83000000;
                dev_kfree_skb(skb);
index 8c07ffc9c244b457119f756e3eaf3c6707a1f617..27911c07558d928b82c82d2a295927da6e4da8e8 100644 (file)
@@ -420,8 +420,7 @@ static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
        mp->stats.tx_bytes += skb->len;
 
        /* We need to copy into our xmit buffer to take care of alignment and caching issues */
-
-       memcpy((void *) mp->tx_ring, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, mp->tx_ring, skb->len);
 
        /* load the Tx DMA and fire it off */
 
index fafe67835238b0fa4937775cb094498e36bc16a6..0343ea12b299638770b46d0af70658f7b17b3f0b 100644 (file)
@@ -608,7 +608,7 @@ static void meth_tx_short_prepare(struct meth_private *priv,
 
        desc->header.raw = METH_TX_CMD_INT_EN | (len-1) | ((128-len) << 16);
        /* maybe I should set whole thing to 0 first... */
-       memcpy(desc->data.dt + (120 - len), skb->data, skb->len);
+       skb_copy_from_linear_data(skb, desc->data.dt + (120 - len), skb->len);
        if (skb->len < len)
                memset(desc->data.dt + 120 - len + skb->len, 0, len-skb->len);
 }
@@ -626,8 +626,8 @@ static void meth_tx_1page_prepare(struct meth_private *priv,
 
        /* unaligned part */
        if (unaligned_len) {
-               memcpy(desc->data.dt + (120 - unaligned_len),
-                      skb->data, unaligned_len);
+               skb_copy_from_linear_data(skb, desc->data.dt + (120 - unaligned_len),
+                             unaligned_len);
                desc->header.raw |= (128 - unaligned_len) << 16;
        }
 
@@ -652,8 +652,8 @@ static void meth_tx_2page_prepare(struct meth_private *priv,
        desc->header.raw = METH_TX_CMD_INT_EN | TX_CATBUF1 | TX_CATBUF2| (skb->len - 1);
        /* unaligned part */
        if (unaligned_len){
-               memcpy(desc->data.dt + (120 - unaligned_len),
-                      skb->data, unaligned_len);
+               skb_copy_from_linear_data(skb, desc->data.dt + (120 - unaligned_len),
+                             unaligned_len);
                desc->header.raw |= (128 - unaligned_len) << 16;
        }
 
index e1f16fb058468dab9280795dc42998f329fb8df7..13444da93273b5762f2798ac124d2108f56d2f39 100644 (file)
@@ -502,7 +502,7 @@ static void myri_rx(struct myri_eth *mp, struct net_device *dev)
                        copy_skb->dev = dev;
                        DRX(("resv_and_put "));
                        skb_put(copy_skb, len);
-                       memcpy(copy_skb->data, skb->data, len);
+                       skb_copy_from_linear_data(skb, copy_skb->data, len);
 
                        /* Reuse original ring buffer. */
                        DRX(("reuse "));
index b488e94bc4c0fe8af88027df880d5131da08b38b..ab25c225a07e011255068d470c53eb8fbe4fc612 100644 (file)
@@ -920,8 +920,10 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                        /* copy the next 64 bytes - should be enough except
                         * for pathological case
                         */
-                       memcpy((void *)hwdesc, (void *)(skb->data) +
-                              first_hdr_len, hdr_len - first_hdr_len);
+                       skb_copy_from_linear_data_offset(skb, first_hdr_len,
+                                                        hwdesc,
+                                                        (hdr_len -
+                                                         first_hdr_len));
                        producer = get_next_index(producer, max_tx_desc_count);
                }
        }
index 70b6812a8a756b58e2f7cd0a8b26b9681ab23793..8646698c77d47dfb8db6b5669ee4cb7b5c662988 100644 (file)
@@ -1182,7 +1182,7 @@ static int ni52_send_packet(struct sk_buff *skb, struct net_device *dev)
        else
 #endif
        {
-               memcpy((char *)p->xmit_cbuffs[p->xmit_count],(char *)(skb->data),skb->len);
+               skb_copy_from_linear_data(skb, p->xmit_cbuffs[p->xmit_count], skb->len);
                len = skb->len;
                if (len < ETH_ZLEN) {
                        len = ETH_ZLEN;
index 782201d12c226070619460b2f48ecf511831a288..3818edf0ac18c8ad443d712ebc31c3b2404df1fd 100644 (file)
@@ -1176,8 +1176,9 @@ static int ni65_send_packet(struct sk_buff *skb, struct net_device *dev)
                if( (unsigned long) (skb->data + skb->len) > 0x1000000) {
 #endif
 
-                       memcpy((char *) p->tmdbounce[p->tmdbouncenum] ,(char *)skb->data,
-                                                        (skb->len > T_BUF_SIZE) ? T_BUF_SIZE : skb->len);
+                       skb_copy_from_linear_data(skb, p->tmdbounce[p->tmdbouncenum],
+                                     skb->len > T_BUF_SIZE ? T_BUF_SIZE :
+                                                             skb->len);
                        if (len > skb->len)
                                memset((char *)p->tmdbounce[p->tmdbouncenum]+skb->len, 0, len-skb->len);
                        dev_kfree_skb (skb);
index 099972c977ef7b194c76e1ce12dae618cad7e001..df8998b4f37ee5819b07af0a60a8f45e017d5b80 100644 (file)
@@ -1344,7 +1344,7 @@ static int netdrv_start_xmit (struct sk_buff *skb, struct net_device *dev)
 
        tp->tx_info[entry].skb = skb;
        /* tp->tx_info[entry].mapping = 0; */
-       memcpy (tp->tx_buf[entry], skb->data, skb->len);
+       skb_copy_from_linear_data(skb, tp->tx_buf[entry], skb->len);
 
        /* Note: the chip doesn't have auto-pad! */
        NETDRV_W32 (TxStatus0 + (entry * sizeof(u32)),
index fabbe95c7ef1f7e0ee6d1a674827224ec96337e8..808fae1577e0d8feea3be1ab3e263e599c870ed9 100644 (file)
@@ -1136,7 +1136,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
                ei_block_output(dev, length, skb->data, output_page);
        else {
                memset(packet, 0, ETH_ZLEN);
-               memcpy(packet, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, packet, skb->len);
                ei_block_output(dev, length, packet, output_page);
        }
        
index b6f0e9a25e26dada081eba2e45432b649da9f08f..5918fab38349589baace76b4c3c1d812a2046a8e 100644 (file)
@@ -594,7 +594,8 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb)
                                return NULL;
                        }
                        skb_reserve(npkt,2);
-                       memcpy(skb_put(npkt,skb->len), skb->data, skb->len);
+                       skb_copy_from_linear_data(skb,
+                                     skb_put(npkt, skb->len), skb->len);
                        kfree_skb(skb);
                        skb = npkt;
                }
index e94790632d558b6b5b4221fcccf0905a4630ed75..e9fb616ff663e6a6bf629b5b1465a3376bf862d4 100644 (file)
@@ -869,7 +869,8 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb)
                        goto abort;
 
                skb_reserve(skb2, dev->hard_header_len + sizeof(struct pppoe_hdr));
-               memcpy(skb_put(skb2, skb->len), skb->data, skb->len);
+               skb_copy_from_linear_data(skb, skb_put(skb2, skb->len),
+                                         skb->len);
        } else {
                /* Make a clone so as to not disturb the original skb,
                 * give dev_queue_xmit something it can free.
index 40d2639eedcb62393ca1cc81f246478aeea8f008..7b80fb7a9d9babb7af240859c3f3d24cafcc9958 100755 (executable)
@@ -1927,7 +1927,8 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev,
                 * Copy the ethhdr from first buffer to second. This
                 * is necessary for 3022 IP completions.
                 */
-               memcpy(skb_push(skb2, size), skb1->data + VLAN_ID_LEN, size);
+               skb_copy_from_linear_data_offset(skb1, VLAN_ID_LEN,
+                                                skb_push(skb2, size), size);
        } else {
                u16 checksum = le16_to_cpu(ib_ip_rsp_ptr->checksum);
                if (checksum & 
index 3a4fce384504a8c5c673a16eba09a432335b84ed..25c73d47daad9c29c0bb52e5c9035efbd9818909 100644 (file)
@@ -1451,7 +1451,7 @@ static int rr_start_xmit(struct sk_buff *skb, struct net_device *dev)
                }
                skb_reserve(new_skb, 8);
                skb_put(new_skb, len);
-               memcpy(new_skb->data, skb->data, len);
+               skb_copy_from_linear_data(skb, new_skb->data, len);
                dev_kfree_skb(skb);
                skb = new_skb;
        }
index 5a89191321867ee9962d3e2f0888c9dc301a21b6..d8c9c5d66d4fb7a94ddab84444e521cd3221e76c 100644 (file)
@@ -534,7 +534,7 @@ static int sgiseeq_start_xmit(struct sk_buff *skb, struct net_device *dev)
         *    entry and the HPC got to the end of the chain before we
         *    added this new entry and restarted it.
         */
-       memcpy((char *)(long)td->buf_vaddr, skb->data, skblen);
+       skb_copy_from_linear_data(skb, (char *)(long)td->buf_vaddr, skblen);
        if (len != skblen)
                memset((char *)(long)td->buf_vaddr + skb->len, 0, len-skblen);
        td->tdma.cntinfo = (len & HPCDMA_BCNT) |
index 99b61cfb7ce669b85057b607444f2032fe292058..f1a0e6c0fbdd81ac4bb8e8da0e2135bd2073f126 100644 (file)
@@ -2950,7 +2950,7 @@ static struct sk_buff *skge_rx_get(struct net_device *dev,
                pci_dma_sync_single_for_cpu(skge->hw->pdev,
                                            pci_unmap_addr(e, mapaddr),
                                            len, PCI_DMA_FROMDEVICE);
-               memcpy(skb->data, e->skb->data, len);
+               skb_copy_from_linear_data(e->skb, skb->data, len);
                pci_dma_sync_single_for_device(skge->hw->pdev,
                                               pci_unmap_addr(e, mapaddr),
                                               len, PCI_DMA_FROMDEVICE);
index fd291fc93169e17fccb77c13fa6e8825bae79b54..238c2ca34da63cbd239fd6f9a92eb4ce347d95d5 100644 (file)
@@ -1971,7 +1971,7 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2,
                skb_reserve(skb, 2);
                pci_dma_sync_single_for_cpu(sky2->hw->pdev, re->data_addr,
                                            length, PCI_DMA_FROMDEVICE);
-               memcpy(skb->data, re->skb->data, length);
+               skb_copy_from_linear_data(re->skb, skb->data, length);
                skb->ip_summed = re->skb->ip_summed;
                skb->csum = re->skb->csum;
                pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
index 5bcc749bef11f60138afcfbe0dbc3a4eea4faada..396c3d961f8857680c6fe86b3f714d6819704df0 100644 (file)
@@ -1026,7 +1026,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
                        memset((char *)p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN);
                        len = ETH_ZLEN;
                }
-               memcpy((char *)p->xmit_cbuffs[p->xmit_count],(char *)(skb->data),skb->len);
+               skb_copy_from_linear_data(skb, p->xmit_cbuffs[p->xmit_count], skb->len);
 
 #if (NUM_XMIT_BUFFS == 1)
 #      ifdef NO_NOPCOMMANDS
index 0454827c8c21599da2697af7855d3fe119c3e7a9..327ed7962fbdeb265dc498be3b88596401c0a1a5 100644 (file)
@@ -629,7 +629,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
        head->length = (-len) | 0xf000;
        head->misc = 0;
 
-       memcpy( PKTBUF_ADDR(head), (void *)skb->data, skb->len );
+       skb_copy_from_linear_data(skb, PKTBUF_ADDR(head), skb->len);
        if (len != skb->len)
                memset(PKTBUF_ADDR(head) + skb->len, 0, len-skb->len);
 
index 4bb89dec565032ee56adf0479b2908afd8213901..9df1038ec6bbba99ca61acd727c546d3dd69ddae 100644 (file)
@@ -848,7 +848,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
                        skb_reserve(copy_skb, 2);
                        skb_put(copy_skb, len);
                        pci_dma_sync_single_for_cpu(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
-                       memcpy(copy_skb->data, skb->data, len);
+                       skb_copy_from_linear_data(skb, copy_skb->data, len);
                        pci_dma_sync_single_for_device(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
 
                        /* We'll reuse the original ring buffer. */
index 4b69c1deb9f3b3992d087233572f6f4fd3719bad..5304d7b94e5e7fe85a5589170e42fd1119d055ba 100644 (file)
@@ -2061,7 +2061,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
                        skb_reserve(copy_skb, 2);
                        skb_put(copy_skb, len);
                        hme_dma_sync_for_cpu(hp, dma_addr, len, DMA_FROMDEVICE);
-                       memcpy(copy_skb->data, skb->data, len);
+                       skb_copy_from_linear_data(skb, copy_skb->data, len);
                        hme_dma_sync_for_device(hp, dma_addr, len, DMA_FROMDEVICE);
 
                        /* Reuse original ring buffer. */
index 8f53a1ef60837231c29b5d79a18d070521d93e34..42722530ab24501f4ca647ea0b702f33557728e4 100644 (file)
@@ -1143,7 +1143,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
                struct lance_init_block *ib = lp->init_block_mem;
                ib->btx_ring [entry].length = (-len) | 0xf000;
                ib->btx_ring [entry].misc = 0;
-               memcpy((char *)&ib->tx_buf [entry][0], skb->data, skblen);
+               skb_copy_from_linear_data(skb, &ib->tx_buf [entry][0], skblen);
                if (len != skblen)
                        memset((char *) &ib->tx_buf [entry][skblen], 0, len - skblen);
                ib->btx_ring [entry].tmd1_bits = (LE_T1_POK | LE_T1_OWN);
index fbfb98284fde769d7d30cfdb58d3f7134ed73592..fa70e0b78af72d3c6ba4e5051bf95ad47273dad4 100644 (file)
@@ -592,7 +592,7 @@ static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Avoid a race... */
        qep->qe_block->qe_txd[entry].tx_flags = TXD_UPDATE;
 
-       memcpy(txbuf, skb->data, len);
+       skb_copy_from_linear_data(skb, txbuf, len);
 
        qep->qe_block->qe_txd[entry].tx_addr = txbuf_dvma;
        qep->qe_block->qe_txd[entry].tx_flags =
index 414365c3198ded3b07861be3a61f6780ee75175d..38383e4e07a1891eaf9739fa080fd3602dc76a34 100644 (file)
@@ -3350,7 +3350,7 @@ static int tg3_rx(struct tg3 *tp, int budget)
                        skb_reserve(copy_skb, 2);
                        skb_put(copy_skb, len);
                        pci_dma_sync_single_for_cpu(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
-                       memcpy(copy_skb->data, skb->data, len);
+                       skb_copy_from_linear_data(skb, copy_skb->data, len);
                        pci_dma_sync_single_for_device(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
 
                        /* We'll reuse the original ring buffer. */
index 2ede3f58cf97b656eccc906800e7053032d290fa..106dc1ef0acb95c37e3c8d21f2721858239c8585 100644 (file)
@@ -1112,7 +1112,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev )
 
        if ( bbuf ) {
                tail_buffer = priv->txBuffer + ( priv->txTail * TLAN_MAX_FRAME_SIZE );
-               memcpy( tail_buffer, skb->data, skb->len );
+               skb_copy_from_linear_data(skb, tail_buffer, skb->len);
        } else {
                tail_list->buffer[0].address = pci_map_single(priv->pciDev, skb->data, skb->len, PCI_DMA_TODEVICE);
                TLan_StoreSKB(tail_list, skb);
index d293423ee8e376365958537daf07b24e46611e6e..e22a3f5333ef40b25f7b694b79a300f310eb80b9 100644 (file)
@@ -937,14 +937,17 @@ static void xl_rx(struct net_device *dev)
                                copy_len = xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen & 0x7FFF ; 
                                frame_length -= copy_len ;  
                                pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
-                               memcpy(skb_put(skb,copy_len), xl_priv->rx_ring_skb[xl_priv->rx_ring_tail]->data, copy_len) ; 
+                               skb_copy_from_linear_data(xl_priv->rx_ring_skb[xl_priv->rx_ring_tail],
+                                                         skb_put(skb, copy_len),
+                                                         copy_len);
                                pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
                                adv_rx_ring(dev) ; 
                        } 
 
                        /* Now we have found the last fragment */
                        pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
-                       memcpy(skb_put(skb,copy_len), xl_priv->rx_ring_skb[xl_priv->rx_ring_tail]->data, frame_length) ; 
+                       skb_copy_from_linear_data(xl_priv->rx_ring_skb[xl_priv->rx_ring_tail],
+                                     skb_put(skb,copy_len), frame_length);
 /*                     memcpy(skb_put(skb,frame_length), bus_to_virt(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr), frame_length) ; */
                        pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
                        adv_rx_ring(dev) ; 
index a62065808881e5a13ccfdf40195b5429de27f9f9..09b3cfb8e809933a30af6f7b58c487f2e0af3eaf 100644 (file)
@@ -845,7 +845,9 @@ static void olympic_rx(struct net_device *dev)
                                                        pci_dma_sync_single_for_cpu(olympic_priv->pdev,
                                                                le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer),
                                                                olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; 
-                                                       memcpy(skb_put(skb,length-4),olympic_priv->rx_ring_skb[rx_ring_last_received]->data,length-4) ; 
+                                                       skb_copy_from_linear_data(olympic_priv->rx_ring_skb[rx_ring_last_received],
+                                                                     skb_put(skb,length - 4),
+                                                                     length - 4);
                                                        pci_dma_sync_single_for_device(olympic_priv->pdev,
                                                                le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer),
                                                                olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
@@ -862,7 +864,9 @@ static void olympic_rx(struct net_device *dev)
                                                                olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; 
                                                        rx_desc = &(olympic_priv->olympic_rx_ring[rx_ring_last_received]);
                                                        cpy_length = (i == 1 ? frag_len : le32_to_cpu(rx_desc->res_length)); 
-                                                       memcpy(skb_put(skb, cpy_length), olympic_priv->rx_ring_skb[rx_ring_last_received]->data, cpy_length) ;
+                                                       skb_copy_from_linear_data(olympic_priv->rx_ring_skb[rx_ring_last_received],
+                                                                     skb_put(skb, cpy_length),
+                                                                     cpy_length);
                                                        pci_dma_sync_single_for_device(olympic_priv->pdev,
                                                                le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer),
                                                                olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
index de6f72775eccff849de67945a145378ac1265698..e6f0817c3509635477b160823e8143aa17bf9e37 100644 (file)
@@ -644,7 +644,7 @@ static int tms380tr_hardware_send_packet(struct sk_buff *skb, struct net_device
                dmabuf  = 0;
                i       = tp->TplFree->TPLIndex;
                buf     = tp->LocalTxBuffers[i];
-               memcpy(buf, skb->data, length);
+               skb_copy_from_linear_data(skb, buf, length);
                newbuf  = ((char *)buf - (char *)tp) + tp->dmabuffer;
        }
        else {
index 8a7effa70904a3e451285c76ab4c0dd00b5add89..d19f8568440f8b9be78078bb9e7da31d9f94b709 100644 (file)
@@ -449,8 +449,8 @@ static void de_rx (struct de_private *de)
                } else {
                        pci_dma_sync_single_for_cpu(de->pdev, mapping, len, PCI_DMA_FROMDEVICE);
                        skb_reserve(copy_skb, RX_OFFSET);
-                       memcpy(skb_put(copy_skb, len), skb->data, len);
-
+                       skb_copy_from_linear_data(skb, skb_put(copy_skb, len),
+                                                 len);
                        pci_dma_sync_single_for_device(de->pdev, mapping, len, PCI_DMA_FROMDEVICE);
 
                        /* We'll reuse the original ring buffer. */
index a5e0237a6537cc8148728d7543d4f29dd3286f5e..b3a64ca9863447d9dffbad5c39383d7c9676d123 100644 (file)
@@ -682,7 +682,7 @@ static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev)
 
        /* transmit this packet */
        txptr = db->tx_insert_ptr;
-       memcpy(txptr->tx_buf_ptr, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, txptr->tx_buf_ptr, skb->len);
        txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len);
 
        /* Point to next transmit free descriptor */
@@ -989,7 +989,9 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
                                                skb = newskb;
                                                /* size less than COPY_SIZE, allocate a rxlen SKB */
                                                skb_reserve(skb, 2); /* 16byte align */
-                                               memcpy(skb_put(skb, rxlen), rxptr->rx_skb_ptr->data, rxlen);
+                                               skb_copy_from_linear_data(rxptr->rx_skb_ptr,
+                                                         skb_put(skb, rxlen),
+                                                                         rxlen);
                                                dmfe_reuse_skb(db, rxptr->rx_skb_ptr);
                                        } else
                                                skb_put(skb, rxlen);
index e46f4cb02c152fa15d73f2abdfd4ee894f1ab423..ca2548eb7d63196f1edd1bd02ee5830d6c007c53 100644 (file)
@@ -583,7 +583,7 @@ static int uli526x_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        /* transmit this packet */
        txptr = db->tx_insert_ptr;
-       memcpy(txptr->tx_buf_ptr, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, txptr->tx_buf_ptr, skb->len);
        txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len);
 
        /* Point to next transmit free descriptor */
index 1fe3734e155b4b5c5fd1797f60332ab9a1f91efa..985a1810ca5945a282cae4a384db1245a21a2705 100644 (file)
@@ -411,9 +411,9 @@ static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
                           sometimes sends more than you ask it to. */
 
                        memset(&card->tx_buffer[bufferoffsets[desc]/4],0,1536);
-                       memcpy(&(card->tx_buffer[bufferoffsets[desc]/4]),skb->data,skb->len);
-
-
+                       skb_copy_from_linear_data(skb,
+                                 &(card->tx_buffer[bufferoffsets[desc] / 4]),
+                                                 skb->len);
                        /* FIXME: The specification tells us that the length we send HAS to be a multiple of
                           4 bytes. */
 
index 3f24c82755fc08d1e69b90e00fa8e21f1f04c8d4..696b3b8aac8ec1edf9912b2778c82891e0655b24 100644 (file)
@@ -915,7 +915,9 @@ xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        tp->tx_skbuff[entry] = skb;
        if (tp->chip_id == X3201_3) {
-               memcpy(tp->tx_aligned_skbuff[entry]->data,skb->data,skb->len);
+               skb_copy_from_linear_data(skb,
+                                         tp->tx_aligned_skbuff[entry]->data,
+                                         skb->len);
                tp->tx_ring[entry].buffer1 = virt_to_bus(tp->tx_aligned_skbuff[entry]->data);
        } else
                tp->tx_ring[entry].buffer1 = virt_to_bus(skb->data);
index 288d8559f8c5c48238a231331156454b0a735288..4d461595406d2333f2a832b7ddfcc011feeede6a 100644 (file)
@@ -386,8 +386,8 @@ static ssize_t tun_chr_aio_read(struct kiocb *iocb, const struct iovec *iv,
                 *   - we are multicast promiscous.
                 *   - we belong to the multicast group.
                 */
-               memcpy(addr, skb->data,
-                      min_t(size_t, sizeof addr, skb->len));
+               skb_copy_from_linear_data(skb, addr, min_t(size_t, sizeof addr,
+                                                                  skb->len));
                bit_nr = ether_crc(sizeof addr, addr) >> 26;
                if ((tun->if_flags & IFF_PROMISC) ||
                                memcmp(addr, tun->dev_addr, sizeof addr) == 0 ||
index 422eaf8ea12d80851200425f8c2bdcb626657d56..25b75b615188ff521c238a0da54021cce20e9100 100644 (file)
@@ -1339,7 +1339,8 @@ static inline int velocity_rx_copy(struct sk_buff **rx_skb, int pkt_size,
                        if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN)
                                skb_reserve(new_skb, 2);
 
-                       memcpy(new_skb->data, rx_skb[0]->data, pkt_size);
+                       skb_copy_from_linear_data(rx_skb[0], new_skb->data,
+                                                 pkt_size);
                        *rx_skb = new_skb;
                        ret = 0;
                }
@@ -1927,7 +1928,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
        if (pktlen < ETH_ZLEN) {
                /* Cannot occur until ZC support */
                pktlen = ETH_ZLEN;
-               memcpy(tdinfo->buf, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, tdinfo->buf, skb->len);
                memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len);
                tdinfo->skb = skb;
                tdinfo->skb_dma[0] = tdinfo->buf_dma;
@@ -1943,7 +1944,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
                int nfrags = skb_shinfo(skb)->nr_frags;
                tdinfo->skb = skb;
                if (nfrags > 6) {
-                       memcpy(tdinfo->buf, skb->data, skb->len);
+                       skb_copy_from_linear_data(skb, tdinfo->buf, skb->len);
                        tdinfo->skb_dma[0] = tdinfo->buf_dma;
                        td_ptr->tdesc0.pktsize =
                        td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
index a576113abbd904dbf1bb7088882ed4c7675a35bb..ae132c1c5459d0e0fe88ac354831bf306d613445 100644 (file)
@@ -1702,7 +1702,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
             if(!nsb) {
                 goto give_it_anyways;
             }
-            memcpy(skb_put(nsb, len), skb->data, len);
+            skb_copy_from_linear_data(skb, skb_put(nsb, len), len);
             
             nsb->protocol = lmc_proto_type(sc, skb);
             skb_reset_mac_header(nsb);
index edbc55528be516ee5628b2b79d6ca85f2791b29b..8ba75bb17326b0317cdadc7ab2f03f95157b2ba4 100644 (file)
@@ -1765,7 +1765,7 @@ cpc_trace(struct net_device *dev, struct sk_buff *skb_main, char rx_tx)
        skb->data[7] = ']';
        skb->data[8] = ':';
        skb->data[9] = ' ';
-       memcpy(&skb->data[10], skb_main->data, skb_main->len);
+       skb_copy_from_linear_data(skb_main, &skb->data[10], skb_main->len);
 
        netif_rx(skb);
 }
index 8b4540bfc1b0b3b7949b86ae5cd6de58ab043b2f..9432d2ce77457523300e6dc71abd5d8aef32c64a 100644 (file)
@@ -1782,7 +1782,7 @@ int z8530_queue_xmit(struct z8530_channel *c, struct sk_buff *skb)
                 */
                c->tx_next_ptr=c->tx_dma_buf[c->tx_dma_used];
                c->tx_dma_used^=1;      /* Flip temp buffer */
-               memcpy(c->tx_next_ptr, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, c->tx_next_ptr, skb->len);
        }
        else
                c->tx_next_ptr=skb->data;       
index 1c17cbe007ba0320b095c13e7faf7ff1d779a7d4..51a7db53afa5f5c02229891dfcf49d77d4260024 100644 (file)
@@ -827,14 +827,14 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
        if (priv->wep_is_on)
                frame_ctl |= IEEE80211_FCTL_PROTECTED;
        if (priv->operating_mode == IW_MODE_ADHOC) {
-               memcpy(&header.addr1, skb->data, 6);
+               skb_copy_from_linear_data(skb, &header.addr1, 6);
                memcpy(&header.addr2, dev->dev_addr, 6);
                memcpy(&header.addr3, priv->BSSID, 6);
        } else {
                frame_ctl |= IEEE80211_FCTL_TODS;
                memcpy(&header.addr1, priv->CurrentBSSID, 6);
                memcpy(&header.addr2, dev->dev_addr, 6);
-               memcpy(&header.addr3, skb->data, 6);
+               skb_copy_from_linear_data(skb, &header.addr3, 6);
        }
 
        if (priv->use_wpa)
index 6e0dc76400e5e309a331d62e7620ed63afac49dd..e3d2e61a31eef7fb3b7593beb5f28d337b8ebd1a 100644 (file)
@@ -998,7 +998,8 @@ static void dma_tx_fragment(struct bcm43xx_dmaring *ring,
                        assert(0);
                        return;
                }
-               memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len);
+               skb_copy_from_linear_data(skb, skb_put(bounce_skb, skb->len),
+                                         skb->len);
                dev_kfree_skb_any(skb);
                skb = bounce_skb;
        }
index 35a3a50724fee1c44036fc3d95bfa6281147cdc4..cbedc9ee740aacdef462a791d277ca582ff921a4 100644 (file)
@@ -933,12 +933,14 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
                if (frag == 0) {
                        /* copy first fragment (including full headers) into
                         * beginning of the fragment cache skb */
-                       memcpy(skb_put(frag_skb, flen), skb->data, flen);
+                       skb_copy_from_linear_data(skb, skb_put(frag_skb, flen),
+                                                 flen);
                } else {
                        /* append frame payload to the end of the fragment
                         * cache skb */
-                       memcpy(skb_put(frag_skb, flen), skb->data + hdrlen,
-                              flen);
+                       skb_copy_from_linear_data_offset(skb, hdrlen,
+                                                        skb_put(frag_skb,
+                                                                flen), flen);
                }
                dev_kfree_skb(skb);
                skb = NULL;
@@ -1044,8 +1046,9 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
            skb->len >= ETH_HLEN + ETH_ALEN) {
                /* Non-standard frame: get addr4 from its bogus location after
                 * the payload */
-               memcpy(skb->data + ETH_ALEN,
-                      skb->data + skb->len - ETH_ALEN, ETH_ALEN);
+               skb_copy_from_linear_data_offset(skb, skb->len - ETH_ALEN,
+                                                skb->data + ETH_ALEN,
+                                                ETH_ALEN);
                skb_trim(skb, skb->len - ETH_ALEN);
        }
 
index 159baef18e4abf982cda0609b4e21c9a0ec78f7c..246fac0e80010bf4537417f0093b6a8d682bffdd 100644 (file)
@@ -146,7 +146,8 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        fc |= IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS;
                        /* From&To DS: Addr1 = RA, Addr2 = TA, Addr3 = DA,
                         * Addr4 = SA */
-                       memcpy(&hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN);
+                       skb_copy_from_linear_data_offset(skb, ETH_ALEN,
+                                                        &hdr.addr4, ETH_ALEN);
                        hdr_len += ETH_ALEN;
                } else {
                        /* bogus 4-addr format to workaround Prism2 station
@@ -159,7 +160,8 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        /* SA from skb->data + ETH_ALEN will be added after
                         * frame payload; use hdr.addr4 as a temporary buffer
                         */
-                       memcpy(&hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN);
+                       skb_copy_from_linear_data_offset(skb, ETH_ALEN,
+                                                        &hdr.addr4, ETH_ALEN);
                        need_tailroom += ETH_ALEN;
                }
 
@@ -174,24 +176,27 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
                else
                        memcpy(&hdr.addr1, local->bssid, ETH_ALEN);
                memcpy(&hdr.addr2, dev->dev_addr, ETH_ALEN);
-               memcpy(&hdr.addr3, skb->data, ETH_ALEN);
+               skb_copy_from_linear_data(skb, &hdr.addr3, ETH_ALEN);
        } else if (local->iw_mode == IW_MODE_MASTER && !to_assoc_ap) {
                fc |= IEEE80211_FCTL_FROMDS;
                /* From DS: Addr1 = DA, Addr2 = BSSID, Addr3 = SA */
-               memcpy(&hdr.addr1, skb->data, ETH_ALEN);
+               skb_copy_from_linear_data(skb, &hdr.addr1, ETH_ALEN);
                memcpy(&hdr.addr2, dev->dev_addr, ETH_ALEN);
-               memcpy(&hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN);
+               skb_copy_from_linear_data_offset(skb, ETH_ALEN, &hdr.addr3,
+                                                ETH_ALEN);
        } else if (local->iw_mode == IW_MODE_INFRA || to_assoc_ap) {
                fc |= IEEE80211_FCTL_TODS;
                /* To DS: Addr1 = BSSID, Addr2 = SA, Addr3 = DA */
                memcpy(&hdr.addr1, to_assoc_ap ?
                       local->assoc_ap_addr : local->bssid, ETH_ALEN);
-               memcpy(&hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
-               memcpy(&hdr.addr3, skb->data, ETH_ALEN);
+               skb_copy_from_linear_data_offset(skb, ETH_ALEN, &hdr.addr2,
+                                                ETH_ALEN);
+               skb_copy_from_linear_data(skb, &hdr.addr3, ETH_ALEN);
        } else if (local->iw_mode == IW_MODE_ADHOC) {
                /* not From/To DS: Addr1 = DA, Addr2 = SA, Addr3 = BSSID */
-               memcpy(&hdr.addr1, skb->data, ETH_ALEN);
-               memcpy(&hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
+               skb_copy_from_linear_data(skb, &hdr.addr1, ETH_ALEN);
+               skb_copy_from_linear_data_offset(skb, ETH_ALEN, &hdr.addr2,
+                                                ETH_ALEN);
                memcpy(&hdr.addr3, local->bssid, ETH_ALEN);
        }
 
index 797d950d5d61ca1e97e14f1a673912024e84e5fd..4ca8a27b8c55bdf773c5edcbda979e02fe4c8ee8 100644 (file)
@@ -1277,8 +1277,8 @@ static char * ap_auth_make_challenge(struct ap_data *ap)
                return NULL;
        }
 
-       memcpy(tmpbuf, skb->data + ap->crypt->extra_mpdu_prefix_len,
-              WLAN_AUTH_CHALLENGE_LEN);
+       skb_copy_from_linear_data_offset(skb, ap->crypt->extra_mpdu_prefix_len,
+                                        tmpbuf, WLAN_AUTH_CHALLENGE_LEN);
        dev_kfree_skb(skb);
 
        return tmpbuf;
index 9003ff7d151af839113e935487e5cbf0e6165bd7..fb01fb95a9f041e285a9cfa48a41d5bc4b67657e 100644 (file)
@@ -1838,13 +1838,14 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev)
 
        /* skb->data starts with txdesc->frame_control */
        hdr_len = 24;
-       memcpy(&txdesc.frame_control, skb->data, hdr_len);
+       skb_copy_from_linear_data(skb, &txdesc.frame_control, hdr_len);
        fc = le16_to_cpu(txdesc.frame_control);
        if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA &&
            (fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS) &&
            skb->len >= 30) {
                /* Addr4 */
-               memcpy(txdesc.addr4, skb->data + hdr_len, ETH_ALEN);
+               skb_copy_from_linear_data_offset(skb, hdr_len, txdesc.addr4,
+                                                ETH_ALEN);
                hdr_len += ETH_ALEN;
        }
 
index ad6e4a42835598bee37d96342d546fccbbbc45b2..9137a4dd02ebb4507f66f0d95237c171c9ac74a3 100644 (file)
@@ -2416,8 +2416,9 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
 #ifdef IPW2100_RX_DEBUG
        /* Make a copy of the frame so we can dump it to the logs if
         * ieee80211_rx fails */
-       memcpy(packet_data, packet->skb->data,
-              min_t(u32, status->frame_size, IPW_RX_NIC_BUFFER_LENGTH));
+       skb_copy_from_linear_data(packet->skb, packet_data,
+                                 min_t(u32, status->frame_size,
+                                            IPW_RX_NIC_BUFFER_LENGTH));
 #endif
 
        if (!ieee80211_rx(priv->ieee, packet->skb, stats)) {
index b04c56a25cc5bec7031a096db40fba9d0a242d45..4839a45098cbc0e9cc759551ef0951d96011fd1d 100644 (file)
@@ -10355,7 +10355,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv,
 
                rt_hdr->it_len = dst->len;
 
-               memcpy(skb_put(dst, len), src->data, len);
+               skb_copy_from_linear_data(src, skb_put(dst, len), len);
 
                if (!ieee80211_rx(priv->prom_priv->ieee, dst, &dummystats))
                        dev_kfree_skb_any(dst);
index 6ebfff0342422875c48409965d0a4d5565461408..7d8bff1dbc4d9ee11d7f237e25a9bb21633fcf3f 100644 (file)
@@ -162,13 +162,16 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 
                        skb_put(newskb, init_wds ? skb->len + 6 : skb->len);
                        if (init_wds) {
-                               memcpy(newskb->data + 6, skb->data, skb->len);
+                               skb_copy_from_linear_data(skb,
+                                                         newskb->data + 6,
+                                                         skb->len);
                                memcpy(newskb->data, wds_mac, 6);
 #ifdef ISLPCI_ETH_DEBUG
                                printk("islpci_eth_transmit:wds_mac\n");
 #endif
                        } else
-                               memcpy(newskb->data, skb->data, skb->len);
+                               skb_copy_from_linear_data(skb, newskb->data,
+                                                         skb->len);
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
                        DEBUG(SHOW_TRACING, "memcpy %p %p %i wds %i\n",
@@ -394,8 +397,10 @@ islpci_eth_receive(islpci_private *priv)
                        /* Update spy records */
                        wireless_spy_update(ndev, annex->addr2, &wstats);
 
-                       memcpy(skb->data + sizeof (struct rfmon_header),
-                              skb->data, 2 * ETH_ALEN);
+                       skb_copy_from_linear_data(skb,
+                                                 (skb->data +
+                                                  sizeof(struct rfmon_header)),
+                                                 2 * ETH_ALEN);
                        skb_pull(skb, sizeof (struct rfmon_header));
                }
                skb->protocol = eth_type_trans(skb, ndev);
index 9633b0457f8c05ca221ad0e0d2ff59b43cf9af32..3be624295a1f79d1a3da70bcbc37620c688b6a8f 100644 (file)
@@ -2242,7 +2242,8 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, unsigned i
     rx_ptr += copy_from_rx_buff(local, rx_ptr, pkt_addr & RX_BUFF_END, rx_len);
     /* Get source address */
 #ifdef WIRELESS_SPY
-    memcpy(linksrcaddr, ((struct mac_header *)skb->data)->addr_2, ETH_ALEN);
+    skb_copy_from_linear_data_offset(skb, offsetof(struct mac_header, addr_2),
+                                    linksrcaddr, ETH_ALEN);
 #endif
     /* Now, deal with encapsulation/translation/sniffer */
     if (!sniffer) {
index 2bf77b1ee531f314f4613fc233a041e6308795c9..1cf090d60edca03edc22382141f56254cc049776 100644 (file)
@@ -2938,7 +2938,7 @@ static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev)
         * need to pad. Jean II */
        if (skb->len < ETH_ZLEN) {
                memset(data, 0, ETH_ZLEN);
-               memcpy(data, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, data, skb->len);
                /* Write packet on the card */
                if(wv_packet_write(dev, data, ETH_ZLEN))
                        return 1;       /* We failed */
index 1fe013a7297a1fd70297e7ea77216a05079d395a..935b144d9b56b419959fd3bd40cf156aa4121ca1 100644 (file)
@@ -807,10 +807,10 @@ static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
        txbuf[4] = 0x00;
        txbuf[5] = 0x00;
 
-       memcpy(txbuf+6, skb->data+12, skb->len-12);
+       skb_copy_from_linear_data_offset(skb, 12, txbuf + 6, skb->len - 12);
        if (pad)
                txbuf[skb->len-12+6]=0;
-       memcpy(txbuf+skb->len-12+6+pad, skb->data, 12);
+       skb_copy_from_linear_data(skb, txbuf + skb->len - 12 + 6 + pad, 12);
        *(__be16*)&txbuf[skb->len+6+pad] = htons(skb->len-12+6);
        txbuf[txbuflen-1] = 0;
 
index 54e3f806cd52e925fee5772ad875f1e771a14ccd..b0f813e6f48ee1fa79aa7ace887e5db340a05eff 100644 (file)
@@ -472,7 +472,8 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
                        privptr->stats.rx_dropped++;
                        return;
                }
-               memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len);
+               skb_copy_from_linear_data(pskb, skb_put(skb, pskb->len),
+                                         pskb->len);
                skb_reset_mac_header(skb);
                skb->dev = pskb->dev;
                skb->protocol = pskb->protocol;
@@ -716,8 +717,9 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg)
                *((__u16 *) skb_put(ch->trans_skb, 2)) = ch->collect_len + 2;
                i = 0;
                while ((skb = skb_dequeue(&ch->collect_queue))) {
-                       memcpy(skb_put(ch->trans_skb, skb->len), skb->data,
-                              skb->len);
+                       skb_copy_from_linear_data(skb, skb_put(ch->trans_skb,
+                                                              skb->len),
+                                                 skb->len);
                        privptr->stats.tx_packets++;
                        privptr->stats.tx_bytes += skb->len - LL_HEADER_LENGTH;
                        atomic_dec(&skb->users);
@@ -2268,8 +2270,9 @@ transmit_skb(struct channel *ch, struct sk_buff *skb)
                        skb_reset_tail_pointer(ch->trans_skb);
                        ch->trans_skb->len = 0;
                        ch->ccw[1].count = skb->len;
-                       memcpy(skb_put(ch->trans_skb, skb->len), skb->data,
-                              skb->len);
+                       skb_copy_from_linear_data(skb, skb_put(ch->trans_skb,
+                                                              skb->len),
+                                                 skb->len);
                        atomic_dec(&skb->users);
                        dev_kfree_skb_irq(skb);
                        ccw_idx = 0;
index 1c23e187a3bafe4a76d0a132183bfb48605d5033..08a994fdd1a4f27bd0a226306f9fe2ad8e136cd4 100644 (file)
@@ -1576,7 +1576,7 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb,
        header->offset = card->tx_buffer->count;
        header->type = card->lan_type;
        header->slot = card->portno;
-       memcpy(header + 1, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, header + 1, skb->len);
        spin_unlock(&card->lock);
        card->stats.tx_bytes += skb->len;
        card->stats.tx_packets++;
index cd42bd54988cd9645de2fcc902e8ea5274b80e14..e10e85e85c842643a48cac9771b10671c38c6b99 100644 (file)
@@ -645,7 +645,8 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
                        privptr->stats.rx_dropped++;
                        return;
                }
-               memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len);
+               skb_copy_from_linear_data(pskb, skb_put(skb, pskb->len),
+                                         pskb->len);
                skb_reset_mac_header(skb);
                skb->dev = pskb->dev;
                skb->protocol = pskb->protocol;
@@ -744,7 +745,9 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg)
                header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN;
                memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header,
                       NETIUCV_HDRLEN);
-               memcpy(skb_put(conn->tx_buff, skb->len), skb->data, skb->len);
+               skb_copy_from_linear_data(skb,
+                                         skb_put(conn->tx_buff, skb->len),
+                                         skb->len);
                txbytes += skb->len;
                txpackets++;
                stat_maxcq++;
index 5890bb5ad23ecb983a78fef325741650edf2adf0..dd7034fbfff89ec8b51fe12788dd35703291bfab 100644 (file)
@@ -267,7 +267,8 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len,
 
        QETH_DBF_TEXT(trace, 5, "eddpcdtc");
        if (skb_shinfo(eddp->skb)->nr_frags == 0) {
-               memcpy(dst, eddp->skb->data + eddp->skb_offset, len);
+               skb_copy_from_linear_data_offset(eddp->skb, eddp->skb_offset,
+                                                dst, len);
                *hcsum = csum_partial(eddp->skb->data + eddp->skb_offset, len,
                                      *hcsum);
                eddp->skb_offset += len;
index a076f735a7bc66a6062d76ed3fcdde996a19d9a2..d287c575522952841bbdd7912611aaf55b90439d 100644 (file)
@@ -484,7 +484,7 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance,
                ptr[4] = 0xec;
                ptr += ATM_CELL_HEADER;
 
-               memcpy(ptr, skb->data, data_len);
+               skb_copy_from_linear_data(skb, ptr, data_len);
                ptr += data_len;
                __skb_pull(skb, data_len);
 
index d82022dd7f2e9762925f0673a3b1c35302cd836b..ffec2e01b896f27f11241403cc5ae6f4c504c24e 100644 (file)
@@ -418,7 +418,7 @@ static int catc_hard_start_xmit(struct sk_buff *skb, struct net_device *netdev)
        catc->tx_ptr = (((catc->tx_ptr - 1) >> 6) + 1) << 6;
        tx_buf = catc->tx_buf[catc->tx_idx] + catc->tx_ptr;
        *((u16*)tx_buf) = (catc->is_f5u011) ? cpu_to_be16((u16)skb->len) : cpu_to_le16((u16)skb->len);
-       memcpy(tx_buf + 2, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, tx_buf + 2, skb->len);
        catc->tx_ptr += skb->len + 2;
 
        if (!test_and_set_bit(TX_RUNNING, &catc->flags))
index 13f70e09ea40ab48bb2324c9400a3931669dff44..1ad4ee54b18691727ae3718e0bd5db762cb69d4e 100644 (file)
@@ -889,7 +889,7 @@ static int pegasus_start_xmit(struct sk_buff *skb, struct net_device *net)
        netif_stop_queue(net);
 
        ((__le16 *) pegasus->tx_buff)[0] = cpu_to_le16(l16);
-       memcpy(pegasus->tx_buff + 2, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, pegasus->tx_buff + 2, skb->len);
        usb_fill_bulk_urb(pegasus->tx_urb, pegasus->usb,
                          usb_sndbulkpipe(pegasus->usb, 2),
                          pegasus->tx_buff, count,
index 1c19b2d55c2b999463f500e1e5aed800538035d6..08c96bcbc59c5830994a1d48fb95d4fdd2402daa 100644 (file)
@@ -1507,6 +1507,20 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
        return buffer;
 }
 
+static inline void skb_copy_from_linear_data(const struct sk_buff *skb,
+                                            void *to,
+                                            const unsigned int len)
+{
+       memcpy(to, skb->data, len);
+}
+
+static inline void skb_copy_from_linear_data_offset(const struct sk_buff *skb,
+                                                   const int offset, void *to,
+                                                   const unsigned int len)
+{
+       memcpy(to, skb->data + offset, len);
+}
+
 extern void skb_init(void);
 
 /**
index e66953ce53e74ccc5f55b54867e6a67d04a6eca1..92b517af7260f988561a88e25764b759ac48faa8 100644 (file)
@@ -150,7 +150,7 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb)
                                skb_reserve(skbn, frontlen + 2);
                                skb_set_network_header(skbn,
                                                      skb_network_offset(skb));
-                               memcpy(skb_put(skbn, len), skb->data, len);
+                               skb_copy_from_linear_data(skb, skb_put(skbn, len), len);
                                p = skb_push(skbn, 2);
 
                                *p++ = AX25_P_SEGMENT;
@@ -164,7 +164,7 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb)
                                skb_reserve(skbn, frontlen + 1);
                                skb_set_network_header(skbn,
                                                      skb_network_offset(skb));
-                               memcpy(skb_put(skbn, len), skb->data, len);
+                               skb_copy_from_linear_data(skb, skb_put(skbn, len), len);
                                p = skb_push(skbn, 1);
                                *p = AX25_P_TEXT;
                        }
index 97156c4abc8d55fee84e56de009573f08bfce986..ab2db55982ca3e4bb51c241ef7b3e6f1869ab0a8 100644 (file)
@@ -382,7 +382,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb)
                break;
        }
 
-       memcpy(__skb_put(nskb, skb->len), skb->data, skb->len);
+       skb_copy_from_linear_data(skb, __skb_put(nskb, skb->len), skb->len);
        kfree_skb(skb);
 
        s->stats.rx_packets++;
index 3933608a92965b3c5cf9459d9cdabad557302312..66bef1ccee2a41fcce9cee029729c28f89429546 100644 (file)
@@ -124,7 +124,7 @@ static inline void cmtp_add_msgpart(struct cmtp_session *session, int id, const
        }
 
        if (skb && (skb->len > 0))
-               memcpy(skb_put(nskb, skb->len), skb->data, skb->len);
+               skb_copy_from_linear_data(skb, skb_put(nskb, skb->len), skb->len);
 
        memcpy(skb_put(nskb, count), buf, count);
 
@@ -256,7 +256,7 @@ static void cmtp_process_transmit(struct cmtp_session *session)
                        hdr[2] = size >> 8;
                }
 
-               memcpy(skb_put(nskb, size), skb->data, size);
+               skb_copy_from_linear_data(skb, skb_put(nskb, size), size);
                skb_pull(skb, size);
 
                if (skb->len > 0) {
index 162eab6a4478c5deaae27bf3e679331084ccb195..a5867879b615ad705c9598efdde641294959488a 100644 (file)
@@ -2107,7 +2107,8 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 fl
                if (!(conn->rx_skb = bt_skb_alloc(len, GFP_ATOMIC)))
                        goto drop;
 
-               memcpy(skb_put(conn->rx_skb, skb->len), skb->data, skb->len);
+               skb_copy_from_linear_data(skb, skb_put(conn->rx_skb, skb->len),
+                             skb->len);
                conn->rx_len = len - skb->len;
        } else {
                BT_DBG("Cont: frag len %d (expecting %d)", skb->len, conn->rx_len);
@@ -2128,7 +2129,8 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 fl
                        goto drop;
                }
 
-               memcpy(skb_put(conn->rx_skb, skb->len), skb->data, skb->len);
+               skb_copy_from_linear_data(skb, skb_put(conn->rx_skb, skb->len),
+                             skb->len);
                conn->rx_len -= skb->len;
 
                if (!conn->rx_len) {
index 8cee7fdc16c31b3d3becfc507f8627c64489cf7c..8b45224699f475df4347d135a5847a27dded759a 100644 (file)
@@ -129,7 +129,8 @@ static inline void nf_bridge_save_header(struct sk_buff *skb)
        if (skb->protocol == htons(ETH_P_8021Q))
                header_size += VLAN_HLEN;
 
-       memcpy(skb->nf_bridge->data, skb->data - header_size, header_size);
+       skb_copy_from_linear_data_offset(skb, -header_size,
+                                        skb->nf_bridge->data, header_size);
 }
 
 /*
index f16c72204cf63325315f27a6cec4946aaa4e6c8d..17c6bb5927b6c22c286da6449aeea94a4c6c0c58 100644 (file)
@@ -576,7 +576,7 @@ struct sk_buff *pskb_copy(struct sk_buff *skb, gfp_t gfp_mask)
        /* Set the tail pointer and length */
        skb_put(n, skb_headlen(skb));
        /* Copy the bytes */
-       memcpy(n->data, skb->data, n->len);
+       skb_copy_from_linear_data(skb, n->data, n->len);
        n->csum      = skb->csum;
        n->ip_summed = skb->ip_summed;
 
@@ -1043,7 +1043,7 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len)
        if ((copy = start - offset) > 0) {
                if (copy > len)
                        copy = len;
-               memcpy(to, skb->data + offset, copy);
+               skb_copy_from_linear_data_offset(skb, offset, to, copy);
                if ((len -= copy) == 0)
                        return 0;
                offset += copy;
@@ -1362,7 +1362,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
 
        BUG_ON(csstart > skb_headlen(skb));
 
-       memcpy(to, skb->data, csstart);
+       skb_copy_from_linear_data(skb, to, csstart);
 
        csum = 0;
        if (csstart != skb->len)
@@ -1536,8 +1536,8 @@ static inline void skb_split_inside_header(struct sk_buff *skb,
 {
        int i;
 
-       memcpy(skb_put(skb1, pos - len), skb->data + len, pos - len);
-
+       skb_copy_from_linear_data_offset(skb, len, skb_put(skb1, pos - len),
+                                        pos - len);
        /* And move data appendix as is. */
        for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
                skb_shinfo(skb1)->frags[i] = skb_shinfo(skb)->frags[i];
@@ -1927,8 +1927,8 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
                skb_set_network_header(nskb, skb->mac_len);
                nskb->transport_header = (nskb->network_header +
                                          skb_network_header_len(skb));
-               memcpy(skb_put(nskb, doffset), skb->data, doffset);
-
+               skb_copy_from_linear_data(skb, skb_put(nskb, doffset),
+                                         doffset);
                if (!sg) {
                        nskb->csum = skb_copy_and_csum_bits(skb, offset,
                                                            skb_put(nskb, len),
@@ -1941,7 +1941,8 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
 
                nskb->ip_summed = CHECKSUM_PARTIAL;
                nskb->csum = skb->csum;
-               memcpy(skb_put(nskb, hsize), skb->data + offset, hsize);
+               skb_copy_from_linear_data_offset(skb, offset,
+                                                skb_put(nskb, hsize), hsize);
 
                while (pos < offset + len) {
                        BUG_ON(i >= nfrags);
index d9498a165acf64ce2c4f87f4df169a5a5a415b86..4074a6e5d0de90531453c3952de4dc1cc75b1bb2 100644 (file)
@@ -362,7 +362,8 @@ static void dn_nsp_conn_conf(struct sock *sk, struct sk_buff *skb)
                        u16 dlen = *skb->data;
                        if ((dlen <= 16) && (dlen <= skb->len)) {
                                scp->conndata_in.opt_optl = dn_htons(dlen);
-                               memcpy(scp->conndata_in.opt_data, skb->data + 1, dlen);
+                               skb_copy_from_linear_data_offset(skb, 1,
+                                             scp->conndata_in.opt_data, dlen);
                        }
                }
                dn_nsp_send_link(sk, DN_NOCHANGE, 0);
@@ -406,7 +407,7 @@ static void dn_nsp_disc_init(struct sock *sk, struct sk_buff *skb)
                u16 dlen = *skb->data;
                if ((dlen <= 16) && (dlen <= skb->len)) {
                        scp->discdata_in.opt_optl = dn_htons(dlen);
-                       memcpy(scp->discdata_in.opt_data, skb->data + 1, dlen);
+                       skb_copy_from_linear_data_offset(skb, 1, scp->discdata_in.opt_data, dlen);
                }
        }
 
index ec6d8851a06103e96e89f1b6cc5db8305cc371fe..4eb35079e4347ead2a557fe19c994bfa445f9b04 100644 (file)
@@ -152,7 +152,7 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
                return -1;
 
        /* Copy the IV into the first 3 bytes of the key */
-       memcpy(key, skb->data + hdr_len, 3);
+       skb_copy_from_linear_data_offset(skb, hdr_len, key, 3);
 
        /* Copy rest of the WEP key (the secret part) */
        memcpy(key + 3, wep->key, wep->key_len);
index 59a765c49cf9e5ab74ce1316b0b7063f660b1aa4..94e2b8e2ab26f814647b9d5625c023aae0bd81a5 100644 (file)
@@ -606,12 +606,12 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                if (frag == 0) {
                        /* copy first fragment (including full headers) into
                         * beginning of the fragment cache skb */
-                       memcpy(skb_put(frag_skb, flen), skb->data, flen);
+                       skb_copy_from_linear_data(skb, skb_put(frag_skb, flen), flen);
                } else {
                        /* append frame payload to the end of the fragment
                         * cache skb */
-                       memcpy(skb_put(frag_skb, flen), skb->data + hdrlen,
-                              flen);
+                       skb_copy_from_linear_data_offset(skb, hdrlen,
+                                     skb_put(frag_skb, flen), flen);
                }
                dev_kfree_skb_any(skb);
                skb = NULL;
index 62a8a2b76539895cc12e4f9283aa458d187c5a7a..a4c3c51140a3a3cb55533f7842cc673fe50bd6a7 100644 (file)
@@ -309,8 +309,8 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        /* Save source and destination addresses */
-       memcpy(dest, skb->data, ETH_ALEN);
-       memcpy(src, skb->data + ETH_ALEN, ETH_ALEN);
+       skb_copy_from_linear_data(skb, dest, ETH_ALEN);
+       skb_copy_from_linear_data_offset(skb, ETH_ALEN, src, ETH_ALEN);
 
        if (host_encrypt || host_build_iv)
                fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA |
@@ -363,7 +363,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
                snapped = 1;
                ieee80211_copy_snap(skb_put(skb_new, SNAP_SIZE + sizeof(u16)),
                                    ether_type);
-               memcpy(skb_put(skb_new, skb->len), skb->data, skb->len);
+               skb_copy_from_linear_data(skb, skb_put(skb_new, skb->len), skb->len);
                res = crypt->ops->encrypt_msdu(skb_new, hdr_len, crypt->priv);
                if (res < 0) {
                        IEEE80211_ERROR("msdu encryption failed\n");
@@ -492,7 +492,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
                        bytes -= SNAP_SIZE + sizeof(u16);
                }
 
-               memcpy(skb_put(skb_frag, bytes), skb->data, bytes);
+               skb_copy_from_linear_data(skb, skb_put(skb_frag, bytes), bytes);
 
                /* Advance the SKB... */
                skb_pull(skb, bytes);
index 875da382d9b9e4dba6b78bc42724786e2d90e212..34606eff8a05d76b4d03095e76dc80736557c59f 100644 (file)
@@ -596,7 +596,7 @@ slow_path:
                 *      Copy the packet header into the new buffer.
                 */
 
-               memcpy(skb_network_header(skb2), skb->data, hlen);
+               skb_copy_from_linear_data(skb, skb_network_header(skb2), hlen);
 
                /*
                 *      Copy a block of the IP datagram.
index be3f082a87ed410723edef3a938962c43274b1c4..4cfdad4e835621a19d7b90a8040fb71ea7856a9c 100644 (file)
@@ -746,7 +746,7 @@ slow_path:
                /*
                 *      Copy the packet header into the new buffer.
                 */
-               memcpy(skb_network_header(frag), skb->data, hlen);
+               skb_copy_from_linear_data(skb, skb_network_header(frag), hlen);
 
                /*
                 *      Build fragment header.
index da3f2bc1b6f62abceb470f2f6407c3a7f680e307..b55bc8f989dfc82ae7d57cfd6c605796ed1ddc5d 100644 (file)
@@ -314,8 +314,8 @@ static inline void irttp_fragment_skb(struct tsap_cb *self,
                skb_reserve(frag, self->max_header_size);
 
                /* Copy data from the original skb into this fragment. */
-               memcpy(skb_put(frag, self->max_seg_size), skb->data,
-                      self->max_seg_size);
+               skb_copy_from_linear_data(skb, skb_put(frag, self->max_seg_size),
+                             self->max_seg_size);
 
                /* Insert TTP header, with the more bit set */
                frame = skb_push(frag, TTP_HEADER);
index 053fa26ff90ab017a66ec1f2067b6174be0e4279..5dc7448925db92cf24376caa770c069025113806 100644 (file)
@@ -1160,7 +1160,8 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
 
        if (sax != NULL) {
                sax->sax25_family = AF_NETROM;
-               memcpy(sax->sax25_call.ax25_call, skb->data + 7, AX25_ADDR_LEN);
+               skb_copy_from_linear_data_offset(skb, 7, sax->sax25_call.ax25_call,
+                             AX25_ADDR_LEN);
        }
 
        msg->msg_namelen = sizeof(*sax);
index 99fdab16ded027c06d59a38d2a1efaf698c18397..f324d5df4186f2c69cae6e39aeb1941dd167d421 100644 (file)
@@ -34,7 +34,7 @@ int nr_loopback_queue(struct sk_buff *skb)
        struct sk_buff *skbn;
 
        if ((skbn = alloc_skb(skb->len, GFP_ATOMIC)) != NULL) {
-               memcpy(skb_put(skbn, skb->len), skb->data, skb->len);
+               skb_copy_from_linear_data(skb, skb_put(skbn, skb->len), skb->len);
                skb_reset_transport_header(skbn);
 
                skb_queue_tail(&loopback_queue, skbn);
index 0cbfb611465b3a6f9580b2bc22b6680901267faf..7c467c95c7d6f12d3764634cc78ea8d4d5d8dd56 100644 (file)
@@ -40,7 +40,7 @@ void nr_output(struct sock *sk, struct sk_buff *skb)
 
        if (skb->len - NR_TRANSPORT_LEN > NR_MAX_PACKET_SIZE) {
                /* Save a copy of the Transport Header */
-               memcpy(transport, skb->data, NR_TRANSPORT_LEN);
+               skb_copy_from_linear_data(skb, transport, NR_TRANSPORT_LEN);
                skb_pull(skb, NR_TRANSPORT_LEN);
 
                frontlen = skb_headroom(skb);
@@ -54,7 +54,7 @@ void nr_output(struct sock *sk, struct sk_buff *skb)
                        len = (NR_MAX_PACKET_SIZE > skb->len) ? skb->len : NR_MAX_PACKET_SIZE;
 
                        /* Copy the user data */
-                       memcpy(skb_put(skbn, len), skb->data, len);
+                       skb_copy_from_linear_data(skb, skb_put(skbn, len), len);
                        skb_pull(skb, len);
 
                        /* Duplicate the Transport Header */
index 07b694d1887079280147030d46aa0360063647ff..04e7d0d2fd8f1c4aa2f6ba249d3b68ea73b16910 100644 (file)
@@ -226,13 +226,13 @@ void __nr_transmit_reply(struct sk_buff *skb, int mine, unsigned char cmdflags)
 
        dptr = skb_put(skbn, NR_NETWORK_LEN + NR_TRANSPORT_LEN);
 
-       memcpy(dptr, skb->data + 7, AX25_ADDR_LEN);
+       skb_copy_from_linear_data_offset(skb, 7, dptr, AX25_ADDR_LEN);
        dptr[6] &= ~AX25_CBIT;
        dptr[6] &= ~AX25_EBIT;
        dptr[6] |= AX25_SSSID_SPARE;
        dptr += AX25_ADDR_LEN;
 
-       memcpy(dptr, skb->data + 0, AX25_ADDR_LEN);
+       skb_copy_from_linear_data(skb, dptr, AX25_ADDR_LEN);
        dptr[6] &= ~AX25_CBIT;
        dptr[6] |= AX25_EBIT;
        dptr[6] |= AX25_SSSID_SPARE;
index 1511697b22baa73b9c025292b48e46b1b3faffcd..f38c3b3471ee91ee06e5bbd49979d1934d13ada2 100644 (file)
@@ -1156,7 +1156,7 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock,
                int lg;
 
                /* Save a copy of the Header */
-               memcpy(header, skb->data, ROSE_MIN_LEN);
+               skb_copy_from_linear_data(skb, header, ROSE_MIN_LEN);
                skb_pull(skb, ROSE_MIN_LEN);
 
                frontlen = skb_headroom(skb);
@@ -1176,7 +1176,7 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock,
                        lg = (ROSE_PACLEN > skb->len) ? skb->len : ROSE_PACLEN;
 
                        /* Copy the user data */
-                       memcpy(skb_put(skbn, lg), skb->data, lg);
+                       skb_copy_from_linear_data(skb, skb_put(skbn, lg), lg);
                        skb_pull(skb, lg);
 
                        /* Duplicate the Header */
index adcda8ebee9c2ec344d9fc48631dba97d8b7dbfc..0d6002fc77b26108973c0e270263ec389db0690e 100644 (file)
@@ -951,7 +951,7 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb,
         *      Incoming Call User Data.
         */
        if (skb->len >= 0) {
-               memcpy(makex25->calluserdata.cuddata, skb->data, skb->len);
+               skb_copy_from_linear_data(skb, makex25->calluserdata.cuddata, skb->len);
                makex25->calluserdata.cudlength = skb->len;
        }
 
index b2bbe552a89d5fd8bb4961e4540d15b271d05fb1..ba13248aa1c31ba79f36f7d52702c2e0b45b361c 100644 (file)
@@ -112,8 +112,9 @@ static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametyp
                         *      Copy any Call User Data.
                         */
                        if (skb->len >= 0) {
-                               memcpy(x25->calluserdata.cuddata, skb->data,
-                                      skb->len);
+                               skb_copy_from_linear_data(skb,
+                                             x25->calluserdata.cuddata,
+                                             skb->len);
                                x25->calluserdata.cudlength = skb->len;
                        }
                        if (!sock_flag(sk, SOCK_DEAD))
index 6f5737853912a9d66185979195d725629e53a873..bb45e21ffce9edf0eb0425e5f564f035fb39141e 100644 (file)
@@ -61,7 +61,7 @@ int x25_output(struct sock *sk, struct sk_buff *skb)
 
        if (skb->len - header_len > max_len) {
                /* Save a copy of the Header */
-               memcpy(header, skb->data, header_len);
+               skb_copy_from_linear_data(skb, header, header_len);
                skb_pull(skb, header_len);
 
                frontlen = skb_headroom(skb);
@@ -84,7 +84,7 @@ int x25_output(struct sock *sk, struct sk_buff *skb)
                        len = max_len > skb->len ? skb->len : max_len;
 
                        /* Copy the user data */
-                       memcpy(skb_put(skbn, len), skb->data, len);
+                       skb_copy_from_linear_data(skb, skb_put(skbn, len), len);
                        skb_pull(skb, len);
 
                        /* Duplicate the Header */