networking: introduce and use skb_put_data()
authorJohannes Berg <johannes.berg@intel.com>
Fri, 16 Jun 2017 12:29:20 +0000 (14:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Jun 2017 15:48:37 +0000 (11:48 -0400)
A common pattern with skb_put() is to just want to memcpy()
some data into the new space, introduce skb_put_data() for
this.

An spatch similar to the one for skb_put_zero() converts many
of the places using it:

    @@
    identifier p, p2;
    expression len, skb, data;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, len);
    |
    -memcpy(p, data, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb, data;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, sizeof(*p));
    |
    -memcpy(p, data, sizeof(*p));
    )

    @@
    expression skb, len, data;
    @@
    -memcpy(skb_put(skb, len), data, len);
    +skb_put_data(skb, data, len);

(again, manually post-processed to retain some comments)

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
252 files changed:
drivers/atm/fore200e.c
drivers/atm/he.c
drivers/atm/idt77252.c
drivers/atm/solos-pci.c
drivers/bluetooth/bfusb.c
drivers/bluetooth/bluecard_cs.c
drivers/bluetooth/btmrvl_main.c
drivers/bluetooth/btqcomsmd.c
drivers/bluetooth/btusb.c
drivers/bluetooth/hci_bcsp.c
drivers/bluetooth/hci_h4.c
drivers/bluetooth/hci_h5.c
drivers/bluetooth/hci_intel.c
drivers/bluetooth/hci_ll.c
drivers/bluetooth/hci_mrvl.c
drivers/bluetooth/hci_qca.c
drivers/char/pcmcia/synclink_cs.c
drivers/firewire/net.c
drivers/isdn/capi/capi.c
drivers/isdn/capi/capidrv.c
drivers/isdn/hardware/avm/b1.c
drivers/isdn/hardware/avm/b1dma.c
drivers/isdn/hardware/avm/c4.c
drivers/isdn/hardware/avm/t1isa.c
drivers/isdn/hardware/mISDN/hfcmulti.c
drivers/isdn/hardware/mISDN/hfcsusb.c
drivers/isdn/hisax/amd7930_fn.c
drivers/isdn/hisax/avm_pci.c
drivers/isdn/hisax/diva.c
drivers/isdn/hisax/elsa_ser.c
drivers/isdn/hisax/hfc_usb.c
drivers/isdn/hisax/hisax_fcpcipnp.c
drivers/isdn/hisax/hisax_isac.c
drivers/isdn/hisax/hscx_irq.c
drivers/isdn/hisax/icc.c
drivers/isdn/hisax/ipacx.c
drivers/isdn/hisax/isac.c
drivers/isdn/hisax/isar.c
drivers/isdn/hisax/isdnl2.c
drivers/isdn/hisax/jade_irq.c
drivers/isdn/hisax/l3_1tr6.c
drivers/isdn/hisax/l3dss1.c
drivers/isdn/hisax/l3ni1.c
drivers/isdn/hisax/netjet.c
drivers/isdn/hisax/st5481_usb.c
drivers/isdn/hisax/w6692.c
drivers/isdn/hysdn/hycapi.c
drivers/isdn/hysdn/hysdn_net.c
drivers/isdn/i4l/isdn_ppp.c
drivers/isdn/i4l/isdn_tty.c
drivers/isdn/i4l/isdn_v110.c
drivers/isdn/isdnloop/isdnloop.c
drivers/isdn/mISDN/dsp_cmx.c
drivers/isdn/mISDN/layer2.c
drivers/isdn/mISDN/tei.c
drivers/media/dvb-core/dvb_net.c
drivers/media/radio/wl128x/fmdrv_common.c
drivers/misc/ti-st/st_core.c
drivers/misc/ti-st/st_kim.c
drivers/net/bonding/bond_alb.c
drivers/net/caif/caif_hsi.c
drivers/net/caif/caif_serial.c
drivers/net/caif/caif_spi.c
drivers/net/caif/caif_virtio.c
drivers/net/can/slcan.c
drivers/net/ethernet/3com/3c515.c
drivers/net/ethernet/3com/3c59x.c
drivers/net/ethernet/aeroflex/greth.c
drivers/net/ethernet/agere/et131x.c
drivers/net/ethernet/apple/macmace.c
drivers/net/ethernet/aurora/nb8800.c
drivers/net/ethernet/cadence/macb.c
drivers/net/ethernet/cavium/liquidio/octeon_network.h
drivers/net/ethernet/cirrus/cs89x0.c
drivers/net/ethernet/dec/tulip/de4x5.c
drivers/net/ethernet/dec/tulip/interrupt.c
drivers/net/ethernet/dec/tulip/uli526x.c
drivers/net/ethernet/ec_bhf.c
drivers/net/ethernet/fealnx.c
drivers/net/ethernet/i825xx/82596.c
drivers/net/ethernet/i825xx/lib82596.c
drivers/net/ethernet/intel/e1000/e1000_main.c
drivers/net/ethernet/marvell/mvneta.c
drivers/net/ethernet/micrel/ksz884x.c
drivers/net/ethernet/nxp/lpc_eth.c
drivers/net/ethernet/qlogic/qede/qede_fp.c
drivers/net/ethernet/qlogic/qlge/qlge_main.c
drivers/net/ethernet/silan/sc92031.c
drivers/net/fjes/fjes_main.c
drivers/net/hamradio/mkiss.c
drivers/net/hippi/rrunner.c
drivers/net/hyperv/netvsc_drv.c
drivers/net/ieee802154/at86rf230.c
drivers/net/ieee802154/ca8210.c
drivers/net/ieee802154/mrf24j40.c
drivers/net/irda/smsc-ircc2.c
drivers/net/irda/vlsi_ir.c
drivers/net/ppp/ppp_async.c
drivers/net/ppp/ppp_synctty.c
drivers/net/slip/slip.c
drivers/net/usb/asix_common.c
drivers/net/usb/cdc-phonet.c
drivers/net/usb/cdc_mbim.c
drivers/net/usb/cdc_ncm.c
drivers/net/usb/gl620a.c
drivers/net/usb/hso.c
drivers/net/usb/ipheth.c
drivers/net/usb/lg-vl600.c
drivers/net/usb/qmi_wwan.c
drivers/net/virtio_net.c
drivers/net/wan/farsync.c
drivers/net/wan/hdlc_ppp.c
drivers/net/wan/x25_asy.c
drivers/net/wimax/i2400m/netdev.c
drivers/net/wireless/admtek/adm8211.c
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath10k/wmi.c
drivers/net/wireless/ath/ath9k/channel.c
drivers/net/wireless/ath/ath9k/wmi.c
drivers/net/wireless/ath/carl9170/rx.c
drivers/net/wireless/ath/wil6210/wmi.c
drivers/net/wireless/atmel/atmel.c
drivers/net/wireless/broadcom/b43legacy/dma.c
drivers/net/wireless/intel/ipw2x00/ipw2200.c
drivers/net/wireless/intel/ipw2x00/libipw_tx.c
drivers/net/wireless/intel/iwlegacy/3945.c
drivers/net/wireless/intel/iwlegacy/4965-mac.c
drivers/net/wireless/intel/iwlwifi/dvm/rx.c
drivers/net/wireless/intel/iwlwifi/dvm/tx.c
drivers/net/wireless/intel/iwlwifi/mvm/d3.c
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
drivers/net/wireless/intel/iwlwifi/mvm/rx.c
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
drivers/net/wireless/intel/iwlwifi/pcie/tx.c
drivers/net/wireless/intersil/hostap/hostap_80211_tx.c
drivers/net/wireless/intersil/hostap/hostap_ap.c
drivers/net/wireless/intersil/hostap/hostap_hw.c
drivers/net/wireless/intersil/hostap/hostap_main.c
drivers/net/wireless/intersil/orinoco/main.c
drivers/net/wireless/intersil/p54/p54spi.c
drivers/net/wireless/intersil/p54/txrx.c
drivers/net/wireless/mac80211_hwsim.c
drivers/net/wireless/marvell/libertas/if_sdio.c
drivers/net/wireless/marvell/mwifiex/11n_aggr.c
drivers/net/wireless/marvell/mwifiex/cfg80211.c
drivers/net/wireless/marvell/mwifiex/tdls.c
drivers/net/wireless/mediatek/mt7601u/dma.c
drivers/net/wireless/mediatek/mt7601u/mcu.c
drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
drivers/net/wireless/realtek/rtlwifi/pci.c
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
drivers/net/wireless/realtek/rtlwifi/usb.c
drivers/net/wireless/rsi/rsi_91x_mgmt.c
drivers/net/wireless/st/cw1200/scan.c
drivers/net/wireless/ti/wl1251/main.c
drivers/net/wireless/ti/wlcore/cmd.c
drivers/net/wireless/ti/wlcore/rx.c
drivers/net/wireless/zydas/zd1201.c
drivers/net/wireless/zydas/zd1211rw/zd_mac.c
drivers/nfc/fdp/fdp.c
drivers/nfc/fdp/i2c.c
drivers/nfc/nfcmrvl/fw_dnld.c
drivers/nfc/nfcmrvl/i2c.c
drivers/nfc/nfcmrvl/usb.c
drivers/nfc/nxp-nci/firmware.c
drivers/nfc/nxp-nci/i2c.c
drivers/nfc/pn533/pn533.c
drivers/nfc/pn533/usb.c
drivers/nfc/port100.c
drivers/nfc/s3fwrn5/firmware.c
drivers/nfc/s3fwrn5/i2c.c
drivers/nfc/st21nfca/dep.c
drivers/nfc/st21nfca/i2c.c
drivers/rpmsg/rpmsg_char.c
drivers/s390/net/ctcm_fsms.c
drivers/s390/net/ctcm_main.c
drivers/s390/net/ctcm_mpc.c
drivers/s390/net/lcs.c
drivers/s390/net/netiucv.c
drivers/s390/net/qeth_core_main.c
drivers/staging/gdm724x/gdm_lte.c
drivers/staging/ks7010/ks_hostif.c
drivers/staging/most/aim-network/networking.c
drivers/staging/octeon/ethernet-rx.c
drivers/staging/rtl8188eu/core/rtw_recv.c
drivers/staging/rtl8188eu/os_dep/mon.c
drivers/staging/rtl8192e/rtllib_rx.c
drivers/staging/rtl8192e/rtllib_softmac.c
drivers/staging/rtl8192e/rtllib_tx.c
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
drivers/staging/rtl8192u/r819xU_cmdpkt.c
drivers/staging/rtl8712/rtl8712_recv.c
drivers/staging/rtl8723bs/os_dep/recv_linux.c
drivers/staging/wilc1000/linux_mon.c
drivers/staging/wilc1000/linux_wlan.c
drivers/staging/wlan-ng/hfa384x_usb.c
drivers/tty/ipwireless/network.c
drivers/tty/n_gsm.c
drivers/tty/synclink.c
drivers/tty/synclink_gt.c
drivers/tty/synclinkmp.c
drivers/usb/gadget/function/f_ncm.c
drivers/usb/gadget/function/f_phonet.c
include/linux/mISDNif.h
include/linux/skbuff.h
lib/nlattr.c
net/batman-adv/bat_iv_ogm.c
net/batman-adv/bat_v_ogm.c
net/batman-adv/fragmentation.c
net/bluetooth/cmtp/core.c
net/bluetooth/hci_core.c
net/bluetooth/hci_request.c
net/bluetooth/hci_sock.c
net/bluetooth/hidp/core.c
net/bluetooth/l2cap_core.c
net/bluetooth/mgmt_util.c
net/bluetooth/rfcomm/tty.c
net/bridge/netfilter/nft_reject_bridge.c
net/can/bcm.c
net/decnet/dn_nsp_out.c
net/ieee802154/6lowpan/tx.c
net/ipv6/mcast.c
net/irda/ircomm/ircomm_tty.c
net/irda/irlap_frame.c
net/key/af_key.c
net/mac80211/ibss.c
net/mac80211/mesh.c
net/mac80211/mlme.c
net/mac80211/offchannel.c
net/mac80211/rx.c
net/mac80211/tdls.c
net/mac80211/tx.c
net/mac80211/util.c
net/netlink/af_netlink.c
net/nfc/digital_dep.c
net/nfc/hci/core.c
net/nfc/llcp_commands.c
net/nfc/llcp_core.c
net/nfc/nci/core.c
net/nfc/nci/data.c
net/nfc/nci/hci.c
net/nfc/nci/uart.c
net/qrtr/qrtr.c
net/sctp/output.c
net/sctp/sm_make_chunk.c
net/vmw_vsock/virtio_transport_common.c
net/x25/x25_subr.c

index 637c3e6b0f9ed3265da287c5a7a61c08180a74e6..7584ae1ded85abb0a4d602a3deb4deaf3f8367c4 100644 (file)
@@ -1104,7 +1104,7 @@ fore200e_push_rpd(struct fore200e* fore200e, struct atm_vcc* vcc, struct rpd* rp
        /* Make device DMA transfer visible to CPU.  */
        fore200e->bus->dma_sync_for_cpu(fore200e, buffer->data.dma_addr, rpd->rsd[ i ].length, DMA_FROM_DEVICE);
        
-       memcpy(skb_put(skb, rpd->rsd[ i ].length), buffer->data.align_addr, rpd->rsd[ i ].length);
+       skb_put_data(skb, buffer->data.align_addr, rpd->rsd[i].length);
 
        /* Now let the device get at it again.  */
        fore200e->bus->dma_sync_for_device(fore200e, buffer->data.dma_addr, rpd->rsd[ i ].length, DMA_FROM_DEVICE);
index 3617659b918482f4ebeca9b9da10d5e393e963d8..461da2bce8efde423018897d77c7c0f094efa7e7 100644 (file)
@@ -1735,7 +1735,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
                __net_timestamp(skb);
 
                list_for_each_entry(heb, &he_vcc->buffers, entry)
-                       memcpy(skb_put(skb, heb->len), &heb->data, heb->len);
+                       skb_put_data(skb, &heb->data, heb->len);
 
                switch (vcc->qos.aal) {
                        case ATM_AAL0:
index 5ec109533bb9129519e066fd2409af8c333eb8bc..4e64de380bda5b0114410cae4a377b046f9f3481 100644 (file)
@@ -1090,8 +1090,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
 
                        *((u32 *) sb->data) = aal0;
                        skb_put(sb, sizeof(u32));
-                       memcpy(skb_put(sb, ATM_CELL_PAYLOAD),
-                              cell, ATM_CELL_PAYLOAD);
+                       skb_put_data(sb, cell, ATM_CELL_PAYLOAD);
 
                        ATM_SKB(sb)->vcc = vcc;
                        __net_timestamp(sb);
@@ -1159,8 +1158,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
                                return;
                        }
                        skb_queue_walk(&rpp->queue, sb)
-                               memcpy(skb_put(skb, sb->len),
-                                      sb->data, sb->len);
+                               skb_put_data(skb, sb->data, sb->len);
 
                        recycle_rx_pool_skb(card, rpp);
 
@@ -1322,8 +1320,7 @@ idt77252_rx_raw(struct idt77252_dev *card)
 
                *((u32 *) sb->data) = header;
                skb_put(sb, sizeof(u32));
-               memcpy(skb_put(sb, ATM_CELL_PAYLOAD), &(queue->data[16]),
-                      ATM_CELL_PAYLOAD);
+               skb_put_data(sb, &(queue->data[16]), ATM_CELL_PAYLOAD);
 
                ATM_SKB(sb)->vcc = vcc;
                __net_timestamp(sb);
@@ -2014,7 +2011,7 @@ idt77252_send_oam(struct atm_vcc *vcc, void *cell, int flags)
        }
        atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
 
-       memcpy(skb_put(skb, 52), cell, 52);
+       skb_put_data(skb, cell, 52);
 
        return idt77252_send_skb(vcc, skb, 1);
 }
index 9115b292e680c16aeb9829ea8b855ba338c00206..077dd15c3a409b2bd4289770613a021aa39c4bb5 100644 (file)
@@ -493,7 +493,7 @@ static int send_command(struct solos_card *card, int dev, const char *buf, size_
        header->vci = cpu_to_le16(0);
        header->type = cpu_to_le16(PKT_COMMAND);
 
-       memcpy(skb_put(skb, size), buf, size);
+       skb_put_data(skb, buf, size);
 
        fpga_queue(card, dev, skb, NULL);
 
index 3bf4ec60e073608d558ff5e5b8fb8273ce043d56..ab090a313a5f1c2218ab46072e17f5d8bd54ca90 100644 (file)
@@ -335,7 +335,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
        }
 
        if (len > 0)
-               memcpy(skb_put(data->reassembly, len), buf, len);
+               skb_put_data(data->reassembly, buf, len);
 
        if (hdr & 0x08) {
                hci_recv_frame(data->hdev, data->reassembly);
@@ -505,7 +505,7 @@ static int bfusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
                buf[1] = 0x00;
                buf[2] = (size == BFUSB_MAX_BLOCK_SIZE) ? 0 : size;
 
-               memcpy(skb_put(nskb, 3), buf, 3);
+               skb_put_data(nskb, buf, 3);
                skb_copy_from_linear_data_offset(skb, sent, skb_put(nskb, size), size);
 
                sent  += size;
@@ -516,7 +516,7 @@ static int bfusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
        if ((nskb->len % data->bulk_pkt_size) == 0) {
                buf[0] = 0xdd;
                buf[1] = 0x00;
-               memcpy(skb_put(nskb, 2), buf, 2);
+               skb_put_data(nskb, buf, 2);
        }
 
        read_lock(&data->lock);
index 007c0a45f31baa18b9da1b3a51e9b63536e1eba5..1d30c116b2eef75afc8ae79fc5b70bf29d69ae77 100644 (file)
@@ -597,7 +597,7 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
                break;
        }
 
-       memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));
+       skb_put_data(skb, cmd, sizeof(cmd));
 
        skb_queue_tail(&(info->txq), skb);
 
index c38cb5b912913c9be380497f1223cf4007f1e865..24a188eab36094bf023390ea1c6cb6b5af06d5cd 100644 (file)
@@ -194,7 +194,7 @@ static int btmrvl_send_sync_cmd(struct btmrvl_private *priv, u16 opcode,
        hdr->plen = len;
 
        if (len)
-               memcpy(skb_put(skb, len), param, len);
+               skb_put_data(skb, param, len);
 
        hci_skb_pkt_type(skb) = MRVL_VENDOR_PKT;
 
index ef730c173d4b875063726ccd398b7cded2e6f660..d00c4fdae9243e01ce2e2fbd0bf6ebe659d2f219 100644 (file)
@@ -43,7 +43,7 @@ static int btqcomsmd_recv(struct hci_dev *hdev, unsigned int type,
        }
 
        hci_skb_pkt_type(skb) = type;
-       memcpy(skb_put(skb, count), data, count);
+       skb_put_data(skb, data, count);
 
        return hci_recv_frame(hdev, skb);
 }
index bfd5f4bdec806c2c093793ccd268045279cb3fe1..c7ea398e65c18e15f6aeda51b854d716eb2fe056 100644 (file)
@@ -478,7 +478,7 @@ static int btusb_recv_intr(struct btusb_data *data, void *buffer, int count)
                }
 
                len = min_t(uint, hci_skb_expect(skb), count);
-               memcpy(skb_put(skb, len), buffer, len);
+               skb_put_data(skb, buffer, len);
 
                count -= len;
                buffer += len;
@@ -533,7 +533,7 @@ static int btusb_recv_bulk(struct btusb_data *data, void *buffer, int count)
                }
 
                len = min_t(uint, hci_skb_expect(skb), count);
-               memcpy(skb_put(skb, len), buffer, len);
+               skb_put_data(skb, buffer, len);
 
                count -= len;
                buffer += len;
@@ -590,7 +590,7 @@ static int btusb_recv_isoc(struct btusb_data *data, void *buffer, int count)
                }
 
                len = min_t(uint, hci_skb_expect(skb), count);
-               memcpy(skb_put(skb, len), buffer, len);
+               skb_put_data(skb, buffer, len);
 
                count -= len;
                buffer += len;
@@ -934,8 +934,8 @@ static void btusb_diag_complete(struct urb *urb)
 
                skb = bt_skb_alloc(urb->actual_length, GFP_ATOMIC);
                if (skb) {
-                       memcpy(skb_put(skb, urb->actual_length),
-                              urb->transfer_buffer, urb->actual_length);
+                       skb_put_data(skb, urb->transfer_buffer,
+                                    urb->actual_length);
                        hci_recv_diag(hdev, skb);
                }
        } else if (urb->status == -ENOENT) {
@@ -2395,7 +2395,7 @@ static int marvell_config_oob_wake(struct hci_dev *hdev)
                return -ENOMEM;
        }
 
-       memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));
+       skb_put_data(skb, cmd, sizeof(cmd));
        hci_skb_pkt_type(skb) = HCI_COMMAND_PKT;
 
        ret = btusb_send_frame(hdev, skb);
index 910ec968f022ae6d141f28cf709d9b18a8e9d59f..d880f4e33c755deae65c23947be368eece5b768f 100644 (file)
@@ -125,7 +125,7 @@ static void bcsp_slip_msgdelim(struct sk_buff *skb)
 {
        const char pkt_delim = 0xc0;
 
-       memcpy(skb_put(skb, 1), &pkt_delim, 1);
+       skb_put_data(skb, &pkt_delim, 1);
 }
 
 static void bcsp_slip_one_byte(struct sk_buff *skb, u8 c)
@@ -135,13 +135,13 @@ static void bcsp_slip_one_byte(struct sk_buff *skb, u8 c)
 
        switch (c) {
        case 0xc0:
-               memcpy(skb_put(skb, 2), &esc_c0, 2);
+               skb_put_data(skb, &esc_c0, 2);
                break;
        case 0xdb:
-               memcpy(skb_put(skb, 2), &esc_db, 2);
+               skb_put_data(skb, &esc_db, 2);
                break;
        default:
-               memcpy(skb_put(skb, 1), &c, 1);
+               skb_put_data(skb, &c, 1);
        }
 }
 
@@ -423,7 +423,7 @@ static void bcsp_handle_le_pkt(struct hci_uart *hu)
                BT_DBG("Found a LE conf pkt");
                if (!nskb)
                        return;
-               memcpy(skb_put(nskb, 4), conf_rsp_pkt, 4);
+               skb_put_data(nskb, conf_rsp_pkt, 4);
                hci_skb_pkt_type(nskb) = BCSP_LE_PKT;
 
                skb_queue_head(&bcsp->unrel, nskb);
@@ -447,7 +447,7 @@ static inline void bcsp_unslip_one_byte(struct bcsp_struct *bcsp, unsigned char
                        bcsp->rx_esc_state = BCSP_ESCSTATE_ESC;
                        break;
                default:
-                       memcpy(skb_put(bcsp->rx_skb, 1), &byte, 1);
+                       skb_put_data(bcsp->rx_skb, &byte, 1);
                        if ((bcsp->rx_skb->data[0] & 0x40) != 0 &&
                            bcsp->rx_state != BCSP_W4_CRC)
                                bcsp_crc_update(&bcsp->message_crc, byte);
@@ -458,7 +458,7 @@ static inline void bcsp_unslip_one_byte(struct bcsp_struct *bcsp, unsigned char
        case BCSP_ESCSTATE_ESC:
                switch (byte) {
                case 0xdc:
-                       memcpy(skb_put(bcsp->rx_skb, 1), &c0, 1);
+                       skb_put_data(bcsp->rx_skb, &c0, 1);
                        if ((bcsp->rx_skb->data[0] & 0x40) != 0 &&
                            bcsp->rx_state != BCSP_W4_CRC)
                                bcsp_crc_update(&bcsp->message_crc, 0xc0);
@@ -467,7 +467,7 @@ static inline void bcsp_unslip_one_byte(struct bcsp_struct *bcsp, unsigned char
                        break;
 
                case 0xdd:
-                       memcpy(skb_put(bcsp->rx_skb, 1), &db, 1);
+                       skb_put_data(bcsp->rx_skb, &db, 1);
                        if ((bcsp->rx_skb->data[0] & 0x40) != 0 &&
                            bcsp->rx_state != BCSP_W4_CRC)
                                bcsp_crc_update(&bcsp->message_crc, 0xdb);
index 82e5a32b87a43646cf49721e0f39a1671d498897..4e328d7d47bb3cfed9e9d8c5dc323c6388fa8ff8 100644 (file)
@@ -209,7 +209,7 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
                }
 
                len = min_t(uint, hci_skb_expect(skb) - skb->len, count);
-               memcpy(skb_put(skb, len), buffer, len);
+               skb_put_data(skb, buffer, len);
 
                count -= len;
                buffer += len;
index 90d0456b67446bcc624fab4b1542c4eaf21531b1..c0e4e26dc30d7c3c6a771b7b86df88c8cf763646 100644 (file)
@@ -109,7 +109,7 @@ static void h5_link_control(struct hci_uart *hu, const void *data, size_t len)
 
        hci_skb_pkt_type(nskb) = HCI_3WIRE_LINK_PKT;
 
-       memcpy(skb_put(nskb, len), data, len);
+       skb_put_data(nskb, data, len);
 
        skb_queue_tail(&h5->unrel, nskb);
 }
@@ -487,7 +487,7 @@ static void h5_unslip_one_byte(struct h5 *h5, unsigned char c)
                }
        }
 
-       memcpy(skb_put(h5->rx_skb, 1), byte, 1);
+       skb_put_data(h5->rx_skb, byte, 1);
        h5->rx_pending--;
 
        BT_DBG("unsliped 0x%02hhx, rx_pending %zu", *byte, h5->rx_pending);
@@ -579,7 +579,7 @@ static void h5_slip_delim(struct sk_buff *skb)
 {
        const char delim = SLIP_DELIMITER;
 
-       memcpy(skb_put(skb, 1), &delim, 1);
+       skb_put_data(skb, &delim, 1);
 }
 
 static void h5_slip_one_byte(struct sk_buff *skb, u8 c)
@@ -589,13 +589,13 @@ static void h5_slip_one_byte(struct sk_buff *skb, u8 c)
 
        switch (c) {
        case SLIP_DELIMITER:
-               memcpy(skb_put(skb, 2), &esc_delim, 2);
+               skb_put_data(skb, &esc_delim, 2);
                break;
        case SLIP_ESC:
-               memcpy(skb_put(skb, 2), &esc_esc, 2);
+               skb_put_data(skb, &esc_esc, 2);
                break;
        default:
-               memcpy(skb_put(skb, 1), &c, 1);
+               skb_put_data(skb, &c, 1);
        }
 }
 
index 851bee82df2ac3a3d9a169596234a709d072beb0..16e728577cd80931e7796a1eb76dd4cd07829e98 100644 (file)
@@ -185,7 +185,7 @@ static int intel_lpm_suspend(struct hci_uart *hu)
                return -ENOMEM;
        }
 
-       memcpy(skb_put(skb, sizeof(suspend)), suspend, sizeof(suspend));
+       skb_put_data(skb, suspend, sizeof(suspend));
        hci_skb_pkt_type(skb) = HCI_LPM_PKT;
 
        set_bit(STATE_LPM_TRANSACTION, &intel->flags);
@@ -270,8 +270,7 @@ static int intel_lpm_host_wake(struct hci_uart *hu)
                return -ENOMEM;
        }
 
-       memcpy(skb_put(skb, sizeof(lpm_resume_ack)), lpm_resume_ack,
-              sizeof(lpm_resume_ack));
+       skb_put_data(skb, lpm_resume_ack, sizeof(lpm_resume_ack));
        hci_skb_pkt_type(skb) = HCI_LPM_PKT;
 
        /* LPM flow is a priority, enqueue packet at list head */
@@ -522,7 +521,7 @@ static int intel_set_baudrate(struct hci_uart *hu, unsigned int speed)
                return -ENOMEM;
        }
 
-       memcpy(skb_put(skb, sizeof(speed_cmd)), speed_cmd, sizeof(speed_cmd));
+       skb_put_data(skb, speed_cmd, sizeof(speed_cmd));
        hci_skb_pkt_type(skb) = HCI_COMMAND_PKT;
 
        hci_uart_set_flow_control(hu, true);
index 2b16d48d82ee94ed7cf43610b2f3024d43888fa0..cc2fa78b434e420c1c8faa82d697e93b57a5fa4b 100644 (file)
@@ -413,7 +413,7 @@ static int ll_recv(struct hci_uart *hu, const void *data, int count)
        while (count) {
                if (ll->rx_count) {
                        len = min_t(unsigned int, ll->rx_count, count);
-                       memcpy(skb_put(ll->rx_skb, len), ptr, len);
+                       skb_put_data(ll->rx_skb, ptr, len);
                        ll->rx_count -= len; count -= len; ptr += len;
 
                        if (ll->rx_count)
index bbc4b39b1dbf393fb607b038f6cfdaecc509ed3f..ffb00669346f0ee70045043e82af0651e80591ba 100644 (file)
@@ -328,7 +328,7 @@ static int mrvl_load_firmware(struct hci_dev *hdev, const char *name)
                }
                bt_cb(skb)->pkt_type = MRVL_RAW_DATA;
 
-               memcpy(skb_put(skb, mrvl->tx_len), fw_ptr, mrvl->tx_len);
+               skb_put_data(skb, fw_ptr, mrvl->tx_len);
                fw_ptr += mrvl->tx_len;
 
                set_bit(STATE_FW_REQ_PENDING, &mrvl->flags);
index f242dfd0c2e2b66d95c013c046efe86cea8a9220..b55f0132063153c21e8c40d2d9c2052ff63906d9 100644 (file)
@@ -869,7 +869,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
        }
 
        /* Assign commands to change baudrate and packet type. */
-       memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));
+       skb_put_data(skb, cmd, sizeof(cmd));
        hci_skb_pkt_type(skb) = HCI_COMMAND_PKT;
 
        skb_queue_tail(&qca->txq, skb);
index d136db1a10f01bffae939aebd9ff36939a1cd76e..62be953e5fb0b655ac68e93709883f378ddc5e59 100644 (file)
@@ -4235,7 +4235,7 @@ static void hdlcdev_rx(MGSLPC_INFO *info, char *buf, int size)
                return;
        }
 
-       memcpy(skb_put(skb, size), buf, size);
+       skb_put_data(skb, buf, size);
 
        skb->protocol = hdlc_type_trans(skb, dev);
 
index 5d3640264f2da1322c76b0aacf01bd2d5cd0f00e..d5040bbd34e84135aa50964d4f4a10dfeec49698 100644 (file)
@@ -600,7 +600,7 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
                        return -ENOMEM;
                }
                skb_reserve(skb, LL_RESERVED_SPACE(net));
-               memcpy(skb_put(skb, len), buf, len);
+               skb_put_data(skb, buf, len);
 
                return fwnet_finish_incoming_packet(net, skb, source_node_id,
                                                    is_broadcast, ether_type);
index 6a2df3297e77c92e4ca47d460ad41c9363425842..77be17590866f1e69a58e33959be18524ec4527d 100644 (file)
@@ -1058,7 +1058,7 @@ static int capinc_tty_write(struct tty_struct *tty,
        }
 
        skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
-       memcpy(skb_put(skb, count), buf, count);
+       skb_put_data(skb, buf, count);
 
        __skb_queue_tail(&mp->outqueue, skb);
        mp->outbytes += skb->len;
index 85cfa4f8691f59e4a674f41377de91e300593b7d..89dd1303a98a13925c90a09d2089a2870c3ea928 100644 (file)
@@ -516,7 +516,7 @@ static void send_message(capidrv_contr *card, _cmsg *cmsg)
                printk(KERN_ERR "capidrv::send_message: can't allocate mem\n");
                return;
        }
-       memcpy(skb_put(skb, len), cmsg->buf, len);
+       skb_put_data(skb, cmsg->buf, len);
        if (capi20_put_message(&global.ap, skb) != CAPI_NOERROR)
                kfree_skb(skb);
 }
index 9fdbd99c7547495556886167a66d9a59e1d6e220..b1833d08a5fea2865e1cd1b916b168fdfa171aa0 100644 (file)
@@ -529,8 +529,8 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
                        printk(KERN_ERR "%s: incoming packet dropped\n",
                               card->name);
                } else {
-                       memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
-                       memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
+                       skb_put_data(skb, card->msgbuf, MsgLen);
+                       skb_put_data(skb, card->databuf, DataB3Len);
                        capi_ctr_handle_message(ctrl, ApplId, skb);
                }
                break;
@@ -544,7 +544,7 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
                               card->name);
                        spin_unlock_irqrestore(&card->lock, flags);
                } else {
-                       memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
+                       skb_put_data(skb, card->msgbuf, MsgLen);
                        if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF)
                                capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
                                                     CAPIMSG_NCCI(skb->data),
index 818bd8f231dba327ab623d0adf95baf78568abbb..9538a9e5e1a83fb5cb93d42f35c5ef588afa8b92 100644 (file)
@@ -474,8 +474,8 @@ static void b1dma_handle_rx(avmcard *card)
                        printk(KERN_ERR "%s: incoming packet dropped\n",
                               card->name);
                } else {
-                       memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
-                       memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
+                       skb_put_data(skb, card->msgbuf, MsgLen);
+                       skb_put_data(skb, card->databuf, DataB3Len);
                        capi_ctr_handle_message(ctrl, ApplId, skb);
                }
                break;
@@ -488,7 +488,7 @@ static void b1dma_handle_rx(avmcard *card)
                        printk(KERN_ERR "%s: incoming packet dropped\n",
                               card->name);
                } else {
-                       memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
+                       skb_put_data(skb, card->msgbuf, MsgLen);
                        if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF) {
                                spin_lock(&card->lock);
                                capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
index 17beb2869dc17da80d5c56dd02f7a17b16cc2b49..40c7e2cf423bfeae548c484335cf9916d602fb38 100644 (file)
@@ -536,8 +536,8 @@ static void c4_handle_rx(avmcard *card)
                        printk(KERN_ERR "%s: incoming packet dropped\n",
                               card->name);
                } else {
-                       memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
-                       memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
+                       skb_put_data(skb, card->msgbuf, MsgLen);
+                       skb_put_data(skb, card->databuf, DataB3Len);
                        capi_ctr_handle_message(ctrl, ApplId, skb);
                }
                break;
@@ -555,7 +555,7 @@ static void c4_handle_rx(avmcard *card)
                        printk(KERN_ERR "%s: incoming packet dropped\n",
                               card->name);
                } else {
-                       memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
+                       skb_put_data(skb, card->msgbuf, MsgLen);
                        if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF)
                                capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
                                                     CAPIMSG_NCCI(skb->data),
index 9516203c735f9fa0598c6c8a9c0eb895e2fdc73f..9f80d20ced873f37728357578b54b5dca4b42888 100644 (file)
@@ -171,8 +171,8 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
                                printk(KERN_ERR "%s: incoming packet dropped\n",
                                       card->name);
                        } else {
-                               memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
-                               memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
+                               skb_put_data(skb, card->msgbuf, MsgLen);
+                               skb_put_data(skb, card->databuf, DataB3Len);
                                capi_ctr_handle_message(ctrl, ApplId, skb);
                        }
                        break;
@@ -186,7 +186,7 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
                                printk(KERN_ERR "%s: incoming packet dropped\n",
                                       card->name);
                        } else {
-                               memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
+                               skb_put_data(skb, card->msgbuf, MsgLen);
                                if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3)
                                        capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
                                                             CAPIMSG_NCCI(skb->data),
index 961c07ee47b7337005a2997b557b0539aebff2fa..aea0c9616ea51cfac248e50958ac838fcf72f5a9 100644 (file)
@@ -1926,7 +1926,7 @@ hfcmulti_dtmf(struct hfc_multi *hc)
                        hh = mISDN_HEAD_P(skb);
                        hh->prim = PH_CONTROL_IND;
                        hh->id = DTMF_HFC_COEF;
-                       memcpy(skb_put(skb, 512), hc->chan[ch].coeff, 512);
+                       skb_put_data(skb, hc->chan[ch].coeff, 512);
                        recv_Bchannel_skb(bch, skb);
                }
        }
@@ -2332,8 +2332,7 @@ next_frame:
                                skb = *sp;
                                *sp = mI_alloc_skb(skb->len, GFP_ATOMIC);
                                if (*sp) {
-                                       memcpy(skb_put(*sp, skb->len),
-                                              skb->data, skb->len);
+                                       skb_put_data(*sp, skb->data, skb->len);
                                        skb_trim(skb, 0);
                                } else {
                                        printk(KERN_DEBUG "%s: No mem\n",
index 114f3bcba1b0d90f2a05c64523ba7109014c6eea..17cc879ad2bbf784be196528d14a533bf0267b29 100644 (file)
@@ -893,7 +893,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,
                }
        }
 
-       memcpy(skb_put(rx_skb, len), data, len);
+       skb_put_data(rx_skb, data, len);
 
        if (hdlc) {
                /* we have a complete hdlc packet */
index 3a4c2f9e19e9adf81c4d93eb7847ed8b549745e2..dcf4c2a9fcea154582110d45a0ecfac51b92ce75 100644 (file)
@@ -317,7 +317,8 @@ Amd7930_empty_Dfifo(struct IsdnCardState *cs, int flag)
                                                        debugl1(cs, "%s", cs->dlog);
                                                }
                                                /* moves received data in sk-buffer */
-                                               memcpy(skb_put(skb, cs->rcvidx), cs->rcvbuf, cs->rcvidx);
+                                               skb_put_data(skb, cs->rcvbuf,
+                                                            cs->rcvidx);
                                                skb_queue_tail(&cs->rq, skb);
                                        }
                                }
index d1427bd6452dacd5b2fedfa6d8bf9a33a4207e85..daf3742cdef650002eaa76924e681b9f4a04ec74 100644 (file)
@@ -378,8 +378,9 @@ HDLC_irq(struct BCState *bcs, u_int stat) {
                                        if (!(skb = dev_alloc_skb(bcs->hw.hdlc.rcvidx)))
                                                printk(KERN_WARNING "HDLC: receive out of memory\n");
                                        else {
-                                               memcpy(skb_put(skb, bcs->hw.hdlc.rcvidx),
-                                                      bcs->hw.hdlc.rcvbuf, bcs->hw.hdlc.rcvidx);
+                                               skb_put_data(skb,
+                                                            bcs->hw.hdlc.rcvbuf,
+                                                            bcs->hw.hdlc.rcvidx);
                                                skb_queue_tail(&bcs->rqueue, skb);
                                        }
                                        bcs->hw.hdlc.rcvidx = 0;
index 079336e593f95a2970b1b43606ee92b4b7d7ae0f..3fc94e7741ae71a3db3380e8c0e5bebc71b38a97 100644 (file)
@@ -511,7 +511,8 @@ Memhscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx)
                                if (!(skb = dev_alloc_skb(count)))
                                        printk(KERN_WARNING "HSCX: receive out of memory\n");
                                else {
-                                       memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count);
+                                       skb_put_data(skb, bcs->hw.hscx.rcvbuf,
+                                                    count);
                                        skb_queue_tail(&bcs->rqueue, skb);
                                }
                        }
@@ -526,7 +527,8 @@ Memhscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx)
                        if (!(skb = dev_alloc_skb(fifo_size)))
                                printk(KERN_WARNING "HiSax: receive out of memory\n");
                        else {
-                               memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size);
+                               skb_put_data(skb, bcs->hw.hscx.rcvbuf,
+                                            fifo_size);
                                skb_queue_tail(&bcs->rqueue, skb);
                        }
                        bcs->hw.hscx.rcvidx = 0;
index a2a358c1dc8e59fe5b69f99891c8d3130717df8b..999effd7a27688ca733c23b0512af81207194d23 100644 (file)
@@ -333,8 +333,8 @@ static inline void receive_chars(struct IsdnCardState *cs,
                if (!(skb = dev_alloc_skb(cs->hw.elsa.rcvcnt)))
                        printk(KERN_WARNING "ElsaSER: receive out of memory\n");
                else {
-                       memcpy(skb_put(skb, cs->hw.elsa.rcvcnt), cs->hw.elsa.rcvbuf,
-                              cs->hw.elsa.rcvcnt);
+                       skb_put_data(skb, cs->hw.elsa.rcvbuf,
+                                    cs->hw.elsa.rcvcnt);
                        skb_queue_tail(&cs->hw.elsa.bcs->rqueue, skb);
                }
                schedule_event(cs->hw.elsa.bcs, B_RCVBUFREADY);
index 6dbd1f1da14f1e8752caadf6c9f2ca192cc63a3d..ef4748083efd518d56a4474e0e7b86693bf5b4e2 100644 (file)
@@ -799,7 +799,7 @@ collect_rx_frame(usb_fifo *fifo, __u8 *data, int len, int finish)
        }
        if (len) {
                if (fifo->skbuff->len + len < fifo->max_size) {
-                       memcpy(skb_put(fifo->skbuff, len), data, len);
+                       skb_put_data(fifo->skbuff, data, len);
                } else {
                        DBG(HFCUSB_DBG_FIFO_ERR,
                            "HCF-USB: got frame exceeded fifo->max_size(%d) fifo(%d)",
index 5e8a5d967162e919f5db3856e3f897e71718c593..5a9f39ed1d5d97da6427e327786053f6f9ab5ecd 100644 (file)
@@ -495,8 +495,7 @@ static inline void hdlc_rpr_irq(struct fritz_bcs *bcs, u32 stat)
                        if (!skb) {
                                printk(KERN_WARNING "HDLC: receive out of memory\n");
                        } else {
-                               memcpy(skb_put(skb, bcs->rcvidx), bcs->rcvbuf,
-                                      bcs->rcvidx);
+                               skb_put_data(skb, bcs->rcvbuf, bcs->rcvidx);
                                DBG_SKB(1, skb);
                                B_L1L2(bcs, PH_DATA | INDICATION, skb);
                        }
index 5154c252a25fe73e8d4af8de96955f2a2f245a69..0f36375478c5bc0bc94f6977251e75b0f6d22e9c 100644 (file)
@@ -557,7 +557,7 @@ static inline void isac_rme_interrupt(struct isac *isac)
                DBG(DBG_WARN, "no memory, dropping\n");
                goto out;
        }
-       memcpy(skb_put(skb, count), isac->rcvbuf, count);
+       skb_put_data(skb, isac->rcvbuf, count);
        DBG_SKB(DBG_RPACKET, skb);
        D_L1L2(isac, PH_DATA | INDICATION, skb);
 out:
@@ -687,7 +687,7 @@ static inline void isacsx_rme_interrupt(struct isac *isac)
                DBG(DBG_WARN, "no memory, dropping");
                goto out;
        }
-       memcpy(skb_put(skb, count), isac->rcvbuf, count);
+       skb_put_data(skb, isac->rcvbuf, count);
        DBG_SKB(DBG_RPACKET, skb);
        D_L1L2(isac, PH_DATA | INDICATION, skb);
 out:
index a8d6188402c6eacec11ebe4379e1ee9e10dcfe58..0d7e783c8bef1a275dbb02e6b1b47ee63baf1785 100644 (file)
@@ -169,7 +169,8 @@ hscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx)
                                if (!(skb = dev_alloc_skb(count)))
                                        printk(KERN_WARNING "HSCX: receive out of memory\n");
                                else {
-                                       memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count);
+                                       skb_put_data(skb, bcs->hw.hscx.rcvbuf,
+                                                    count);
                                        skb_queue_tail(&bcs->rqueue, skb);
                                }
                        }
@@ -184,7 +185,8 @@ hscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx)
                        if (!(skb = dev_alloc_skb(fifo_size)))
                                printk(KERN_WARNING "HiSax: receive out of memory\n");
                        else {
-                               memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size);
+                               skb_put_data(skb, bcs->hw.hscx.rcvbuf,
+                                            fifo_size);
                                skb_queue_tail(&bcs->rqueue, skb);
                        }
                        bcs->hw.hscx.rcvidx = 0;
index c7c3797a817ebecc285248985fbb4dedc50d6493..8d1804572b32807f637b887c81508c9615e25ac5 100644 (file)
@@ -217,7 +217,7 @@ icc_interrupt(struct IsdnCardState *cs, u_char val)
                                if (!(skb = alloc_skb(count, GFP_ATOMIC)))
                                        printk(KERN_WARNING "HiSax: D receive out of memory\n");
                                else {
-                                       memcpy(skb_put(skb, count), cs->rcvbuf, count);
+                                       skb_put_data(skb, cs->rcvbuf, count);
                                        skb_queue_tail(&cs->rq, skb);
                                }
                        }
index 43effe7082ed9bba9537648eef9d950a0e172785..c426b4fea28a3f4301a6988f97c29294804e7116 100644 (file)
@@ -350,7 +350,7 @@ dch_int(struct IsdnCardState *cs)
                                if (!(skb = dev_alloc_skb(count)))
                                        printk(KERN_WARNING "HiSax dch_int(): receive out of memory\n");
                                else {
-                                       memcpy(skb_put(skb, count), cs->rcvbuf, count);
+                                       skb_put_data(skb, cs->rcvbuf, count);
                                        skb_queue_tail(&cs->rq, skb);
                                }
                        }
@@ -627,7 +627,8 @@ bch_int(struct IsdnCardState *cs, u_char hscx)
                                if (!(skb = dev_alloc_skb(count)))
                                        printk(KERN_WARNING "HiSax bch_int(): receive frame out of memory\n");
                                else {
-                                       memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count);
+                                       skb_put_data(skb, bcs->hw.hscx.rcvbuf,
+                                                    count);
                                        skb_queue_tail(&bcs->rqueue, skb);
                                }
                        }
@@ -644,7 +645,8 @@ bch_int(struct IsdnCardState *cs, u_char hscx)
                        if (!(skb = dev_alloc_skb(B_FIFO_SIZE)))
                                printk(KERN_WARNING "HiSax bch_int(): receive transparent out of memory\n");
                        else {
-                               memcpy(skb_put(skb, B_FIFO_SIZE), bcs->hw.hscx.rcvbuf, B_FIFO_SIZE);
+                               skb_put_data(skb, bcs->hw.hscx.rcvbuf,
+                                            B_FIFO_SIZE);
                                skb_queue_tail(&bcs->rqueue, skb);
                        }
                        bcs->hw.hscx.rcvidx = 0;
index 4273b4548825136624a3687cae20b971fa3e0244..ea965f29a555cc30d2a2d1cd4c20cb57f198dfdd 100644 (file)
@@ -222,7 +222,7 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
                                if (!skb)
                                        printk(KERN_WARNING "HiSax: D receive out of memory\n");
                                else {
-                                       memcpy(skb_put(skb, count), cs->rcvbuf, count);
+                                       skb_put_data(skb, cs->rcvbuf, count);
                                        skb_queue_tail(&cs->rq, skb);
                                }
                        }
index 0dc60b287c4b000b94f3bb97183ad10bfc1254b9..98b4b67ea33786dfa54f4baf8788cbbc4d1a8554 100644 (file)
@@ -458,7 +458,7 @@ send_DLE_ETX(struct BCState *bcs)
        struct sk_buff *skb;
 
        if ((skb = dev_alloc_skb(2))) {
-               memcpy(skb_put(skb, 2), dleetx, 2);
+               skb_put_data(skb, dleetx, 2);
                skb_queue_tail(&bcs->rqueue, skb);
                schedule_event(bcs, B_RCVBUFREADY);
        } else {
@@ -550,8 +550,8 @@ isar_rcv_frame(struct IsdnCardState *cs, struct BCState *bcs)
                                } else if (!(skb = dev_alloc_skb(bcs->hw.isar.rcvidx - 2))) {
                                        printk(KERN_WARNING "ISAR: receive out of memory\n");
                                } else {
-                                       memcpy(skb_put(skb, bcs->hw.isar.rcvidx - 2),
-                                              bcs->hw.isar.rcvbuf, bcs->hw.isar.rcvidx - 2);
+                                       skb_put_data(skb, bcs->hw.isar.rcvbuf,
+                                                    bcs->hw.isar.rcvidx - 2);
                                        skb_queue_tail(&bcs->rqueue, skb);
                                        schedule_event(bcs, B_RCVBUFREADY);
                                }
index c53a53f6efb6a136ec09075996bd89081e50e536..1a40ed04cb524afd33b7f436d43d759b6ee16899 100644 (file)
@@ -433,7 +433,7 @@ send_uframe(struct PStack *st, u_char cmd, u_char cr)
                printk(KERN_WARNING "isdl2 can't alloc sbbuff for send_uframe\n");
                return;
        }
-       memcpy(skb_put(skb, i), tmp, i);
+       skb_put_data(skb, tmp, i);
        enqueue_super(st, skb);
 }
 
@@ -894,7 +894,7 @@ enquiry_cr(struct PStack *st, u_char typ, u_char cr, u_char pf)
                printk(KERN_WARNING "isdl2 can't alloc sbbuff for enquiry_cr\n");
                return;
        }
-       memcpy(skb_put(skb, i), tmp, i);
+       skb_put_data(skb, tmp, i);
        enqueue_super(st, skb);
 }
 
index b930da9b5aa685043aca9d8375d31f5bef14020a..a89e2df911c54e497d5a70c80329254d553d5048 100644 (file)
@@ -147,7 +147,8 @@ jade_interrupt(struct IsdnCardState *cs, u_char val, u_char jade)
                                if (!(skb = dev_alloc_skb(count)))
                                        printk(KERN_WARNING "JADE %s receive out of memory\n", (jade ? "B" : "A"));
                                else {
-                                       memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count);
+                                       skb_put_data(skb, bcs->hw.hscx.rcvbuf,
+                                                    count);
                                        skb_queue_tail(&bcs->rqueue, skb);
                                }
                        }
@@ -162,7 +163,8 @@ jade_interrupt(struct IsdnCardState *cs, u_char val, u_char jade)
                        if (!(skb = dev_alloc_skb(fifo_size)))
                                printk(KERN_WARNING "HiSax: receive out of memory\n");
                        else {
-                               memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size);
+                               skb_put_data(skb, bcs->hw.hscx.rcvbuf,
+                                            fifo_size);
                                skb_queue_tail(&bcs->rqueue, skb);
                        }
                        bcs->hw.hscx.rcvidx = 0;
index 875402e76d0ad62cf7e400f6da19734998bd6129..da0a1c6aa32996e6cab700b19654b819cfa0afa4 100644 (file)
@@ -149,7 +149,7 @@ l3_1tr6_setup_req(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        L3DelTimer(&pc->timer);
        L3AddTimer(&pc->timer, T303, CC_T303);
        newl3state(pc, 1);
@@ -497,7 +497,7 @@ l3_1tr6_setup_rsp(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        L3DelTimer(&pc->timer);
        L3AddTimer(&pc->timer, T313, CC_T313);
@@ -543,7 +543,7 @@ l3_1tr6_disconnect_req(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        L3AddTimer(&pc->timer, T305, CC_T305);
 }
@@ -602,7 +602,7 @@ l3_1tr6_t305(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        L3AddTimer(&pc->timer, T308, CC_T308_1);
 }
index cda700664e9c96afdc95f7b505ac38a9af894ad8..18a3484b1f7e96f33439875ede43704f91feaab8 100644 (file)
@@ -525,7 +525,7 @@ l3dss1_message_cause(struct l3_process *pc, u_char mt, u_char cause)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
 }
 
@@ -551,7 +551,7 @@ l3dss1_status_send(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
 }
 
@@ -587,7 +587,7 @@ l3dss1_msg_without_setup(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        dss1_release_l3_process(pc);
 }
@@ -944,7 +944,7 @@ l3dss1_msg_with_uus(struct l3_process *pc, u_char cmd)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
 } /* l3dss1_msg_with_uus */
 
@@ -1420,7 +1420,7 @@ l3dss1_setup_req(struct l3_process *pc, u_char pr,
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        L3DelTimer(&pc->timer);
        L3AddTimer(&pc->timer, T303, CC_T303);
        newl3state(pc, 1);
@@ -1786,7 +1786,7 @@ l3dss1_disconnect_req(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        newl3state(pc, 11);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        L3AddTimer(&pc->timer, T305, CC_T305);
@@ -1848,7 +1848,7 @@ l3dss1_reject_req(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        pc->st->l3.l3l4(pc->st, CC_RELEASE | INDICATION, pc);
        newl3state(pc, 0);
@@ -2145,7 +2145,7 @@ static void l3dss1_redir_req(struct l3_process *pc, u_char pr, void *arg)
 
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l))) return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
 
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
 } /* l3dss1_redir_req */
@@ -2216,7 +2216,7 @@ static int l3dss1_cmd_global(struct PStack *st, isdn_ctrl *ic)
                                if (pc) dss1_release_l3_process(pc);
                                return (-2);
                        }
-                       memcpy(skb_put(skb, l), temp, l);
+                       skb_put_data(skb, temp, l);
 
                        if (pc)
                        { pc->prot.dss1.invoke_id = id; /* remember id */
@@ -2359,7 +2359,7 @@ l3dss1_t305(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        newl3state(pc, 19);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        L3AddTimer(&pc->timer, T308, CC_T308_1);
@@ -2528,7 +2528,7 @@ l3dss1_suspend_req(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        newl3state(pc, 15);
        L3AddTimer(&pc->timer, T319, CC_T319);
@@ -2603,7 +2603,7 @@ l3dss1_resume_req(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        newl3state(pc, 17);
        L3AddTimer(&pc->timer, T318, CC_T318);
@@ -2721,7 +2721,7 @@ l3dss1_global_restart(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        newl3state(pc, 0);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
 }
@@ -2929,7 +2929,7 @@ global_handler(struct PStack *st, int mt, struct sk_buff *skb)
                l = p - tmp;
                if (!(skb = l3_alloc_skb(l)))
                        return;
-               memcpy(skb_put(skb, l), tmp, l);
+               skb_put_data(skb, tmp, l);
                l3_msg(proc->st, DL_DATA | REQUEST, skb);
        } else {
                if (st->l3.debug & L3_DEB_STATE) {
index 8dc791bfaa6fd0b62d9e37e80429cdcdc6d72ebd..ea311e7df48e739f1eb888b5d8a38e33dcd8c54c 100644 (file)
@@ -454,7 +454,7 @@ l3ni1_message_plus_chid(struct l3_process *pc, u_char mt)
 
        if (!(skb = l3_alloc_skb(7)))
                return;
-       memcpy(skb_put(skb, 7), tmp, 7);
+       skb_put_data(skb, tmp, 7);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
 }
 
@@ -475,7 +475,7 @@ l3ni1_message_cause(struct l3_process *pc, u_char mt, u_char cause)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
 }
 
@@ -501,7 +501,7 @@ l3ni1_status_send(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
 }
 
@@ -537,7 +537,7 @@ l3ni1_msg_without_setup(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        ni1_release_l3_process(pc);
 }
@@ -894,7 +894,7 @@ l3ni1_msg_with_uus(struct l3_process *pc, u_char cmd)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
 } /* l3ni1_msg_with_uus */
 
@@ -1274,7 +1274,7 @@ l3ni1_setup_req(struct l3_process *pc, u_char pr,
        {
                return;
        }
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        L3DelTimer(&pc->timer);
        L3AddTimer(&pc->timer, T303, CC_T303);
        newl3state(pc, 1);
@@ -1640,7 +1640,7 @@ l3ni1_disconnect_req(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        newl3state(pc, 11);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        L3AddTimer(&pc->timer, T305, CC_T305);
@@ -1704,7 +1704,7 @@ l3ni1_reject_req(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        pc->st->l3.l3l4(pc->st, CC_RELEASE | INDICATION, pc);
        newl3state(pc, 0);
@@ -2001,7 +2001,7 @@ static void l3ni1_redir_req(struct l3_process *pc, u_char pr, void *arg)
 
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l))) return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
 
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
 } /* l3ni1_redir_req */
@@ -2076,7 +2076,7 @@ static int l3ni1_cmd_global(struct PStack *st, isdn_ctrl *ic)
                                if (pc) ni1_release_l3_process(pc);
                                return (-2);
                        }
-                       memcpy(skb_put(skb, l), temp, l);
+                       skb_put_data(skb, temp, l);
 
                        if (pc)
                        { pc->prot.ni1.invoke_id = id; /* remember id */
@@ -2219,7 +2219,7 @@ l3ni1_t305(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        newl3state(pc, 19);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        L3AddTimer(&pc->timer, T308, CC_T308_1);
@@ -2388,7 +2388,7 @@ l3ni1_suspend_req(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        newl3state(pc, 15);
        L3AddTimer(&pc->timer, T319, CC_T319);
@@ -2463,7 +2463,7 @@ l3ni1_resume_req(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
        newl3state(pc, 17);
        L3AddTimer(&pc->timer, T318, CC_T318);
@@ -2582,7 +2582,7 @@ l3ni1_global_restart(struct l3_process *pc, u_char pr, void *arg)
        l = p - tmp;
        if (!(skb = l3_alloc_skb(l)))
                return;
-       memcpy(skb_put(skb, l), tmp, l);
+       skb_put_data(skb, tmp, l);
        newl3state(pc, 0);
        l3_msg(pc->st, DL_DATA | REQUEST, skb);
 }
@@ -2655,7 +2655,7 @@ static void l3ni1_SendSpid(struct l3_process *pc, u_char pr, struct sk_buff *skb
        *p++ = IE_SPID;
        *p++ = l;
 
-       memcpy(skb_put(skb, l), pSPID, l);
+       skb_put_data(skb, pSPID, l);
 
        newl3state(pc, iNewState);
 
@@ -2873,7 +2873,7 @@ global_handler(struct PStack *st, int mt, struct sk_buff *skb)
                l = p - tmp;
                if (!(skb = l3_alloc_skb(l)))
                        return;
-               memcpy(skb_put(skb, l), tmp, l);
+               skb_put_data(skb, tmp, l);
                l3_msg(proc->st, DL_DATA | REQUEST, skb);
        } else {
                if (st->l3.debug & L3_DEB_STATE) {
index 233e432e06f69ef03e5ae32f56f24ba133a4d249..b7f54fa292282c7b3dafc8f5be5763091d5ccf3c 100644 (file)
@@ -383,7 +383,7 @@ static void got_frame(struct BCState *bcs, int count) {
        if (!(skb = dev_alloc_skb(count)))
                printk(KERN_WARNING "TIGER: receive out of memory\n");
        else {
-               memcpy(skb_put(skb, count), bcs->hw.tiger.rcvbuf, count);
+               skb_put_data(skb, bcs->hw.tiger.rcvbuf, count);
                skb_queue_tail(&bcs->rqueue, skb);
        }
        test_and_set_bit(B_RCVBUFREADY, &bcs->event);
index a0fdbc074b982a441a18714bbca1b0adfa7eb265..1cb9930d5e24cc23df4ce777f3d5acdd21374985 100644 (file)
@@ -527,7 +527,7 @@ static void usb_in_complete(struct urb *urb)
                                WARNING("receive out of memory\n");
                                break;
                        }
-                       memcpy(skb_put(skb, status), in->rcvbuf, status);
+                       skb_put_data(skb, in->rcvbuf, status);
                        in->hisax_if->l1l2(in->hisax_if, PH_DATA | INDICATION, skb);
                } else if (status == -HDLC_CRC_ERROR) {
                        INFO("CRC error");
index c99f0ec58a0189885cdfdea5ae612f73e30c5925..6f6733b7c1e415bfbecbe3d219abff1082404ea6 100644 (file)
@@ -309,7 +309,9 @@ W6692B_interrupt(struct IsdnCardState *cs, u_char bchan)
                                if (!(skb = dev_alloc_skb(count)))
                                        printk(KERN_WARNING "W6692: Bchan receive out of memory\n");
                                else {
-                                       memcpy(skb_put(skb, count), bcs->hw.w6692.rcvbuf, count);
+                                       skb_put_data(skb,
+                                                    bcs->hw.w6692.rcvbuf,
+                                                    count);
                                        skb_queue_tail(&bcs->rqueue, skb);
                                }
                        }
@@ -332,7 +334,8 @@ W6692B_interrupt(struct IsdnCardState *cs, u_char bchan)
                        if (!(skb = dev_alloc_skb(W_B_FIFO_THRESH)))
                                printk(KERN_WARNING "HiSax: receive out of memory\n");
                        else {
-                               memcpy(skb_put(skb, W_B_FIFO_THRESH), bcs->hw.w6692.rcvbuf, W_B_FIFO_THRESH);
+                               skb_put_data(skb, bcs->hw.w6692.rcvbuf,
+                                            W_B_FIFO_THRESH);
                                skb_queue_tail(&bcs->rqueue, skb);
                        }
                        bcs->hw.w6692.rcvidx = 0;
@@ -441,7 +444,7 @@ StartW6692:
                                if (!(skb = alloc_skb(count, GFP_ATOMIC)))
                                        printk(KERN_WARNING "HiSax: D receive out of memory\n");
                                else {
-                                       memcpy(skb_put(skb, count), cs->rcvbuf, count);
+                                       skb_put_data(skb, cs->rcvbuf, count);
                                        skb_queue_tail(&cs->rq, skb);
                                }
                        }
index 93bae94314a69e7bb2a4502475c3a348e67808a4..87119b51750894f0db79e2447d4f1789a56195fd 100644 (file)
@@ -171,16 +171,16 @@ hycapi_register_internal(struct capi_ctr *ctrl, __u16 appl,
                       card->myid);
                return;
        }
-       memcpy(skb_put(skb, sizeof(__u16)), &len, sizeof(__u16));
-       memcpy(skb_put(skb, sizeof(__u16)), &appl, sizeof(__u16));
+       skb_put_data(skb, &len, sizeof(__u16));
+       skb_put_data(skb, &appl, sizeof(__u16));
        memcpy(skb_put(skb, sizeof(__u8)), &_command, sizeof(_command));
        memcpy(skb_put(skb, sizeof(__u8)), &_subcommand, sizeof(_subcommand));
-       memcpy(skb_put(skb, sizeof(__u16)), &MessageNumber, sizeof(__u16));
-       memcpy(skb_put(skb, sizeof(__u16)), &MessageBufferSize, sizeof(__u16));
-       memcpy(skb_put(skb, sizeof(__u16)), &(rp->level3cnt), sizeof(__u16));
-       memcpy(skb_put(skb, sizeof(__u16)), &(rp->datablkcnt), sizeof(__u16));
-       memcpy(skb_put(skb, sizeof(__u16)), &(rp->datablklen), sizeof(__u16));
-       memcpy(skb_put(skb, slen), ExtFeatureDefaults, slen);
+       skb_put_data(skb, &MessageNumber, sizeof(__u16));
+       skb_put_data(skb, &MessageBufferSize, sizeof(__u16));
+       skb_put_data(skb, &(rp->level3cnt), sizeof(__u16));
+       skb_put_data(skb, &(rp->datablkcnt), sizeof(__u16));
+       skb_put_data(skb, &(rp->datablklen), sizeof(__u16));
+       skb_put_data(skb, ExtFeatureDefaults, slen);
        hycapi_applications[appl - 1].ctrl_mask |= (1 << (ctrl->cnr - 1));
        hycapi_send_message(ctrl, skb);
 }
@@ -279,11 +279,11 @@ static void hycapi_release_internal(struct capi_ctr *ctrl, __u16 appl)
                       card->myid);
                return;
        }
-       memcpy(skb_put(skb, sizeof(__u16)), &len, sizeof(__u16));
-       memcpy(skb_put(skb, sizeof(__u16)), &appl, sizeof(__u16));
+       skb_put_data(skb, &len, sizeof(__u16));
+       skb_put_data(skb, &appl, sizeof(__u16));
        memcpy(skb_put(skb, sizeof(__u8)), &_command, sizeof(_command));
        memcpy(skb_put(skb, sizeof(__u8)), &_subcommand, sizeof(_subcommand));
-       memcpy(skb_put(skb, sizeof(__u16)), &MessageNumber, sizeof(__u16));
+       skb_put_data(skb, &MessageNumber, sizeof(__u16));
        hycapi_send_message(ctrl, skb);
        hycapi_applications[appl - 1].ctrl_mask &= ~(1 << (ctrl->cnr - 1));
 }
@@ -557,10 +557,9 @@ hycapi_rx_capipkt(hysdn_card *card, unsigned char *buf, unsigned short len)
                               card->myid);
                        return;
                }
-               memcpy(skb_put(skb, MsgLen), buf, MsgLen);
-               memcpy(skb_put(skb, 2 * sizeof(__u32)), CP64, 2 * sizeof(__u32));
-               memcpy(skb_put(skb, len - MsgLen), buf + MsgLen,
-                      len - MsgLen);
+               skb_put_data(skb, buf, MsgLen);
+               skb_put_data(skb, CP64, 2 * sizeof(__u32));
+               skb_put_data(skb, buf + MsgLen, len - MsgLen);
                CAPIMSG_SETLEN(skb->data, 30);
        } else {
                if (!(skb = alloc_skb(len, GFP_ATOMIC))) {
@@ -568,7 +567,7 @@ hycapi_rx_capipkt(hysdn_card *card, unsigned char *buf, unsigned short len)
                               card->myid);
                        return;
                }
-               memcpy(skb_put(skb, len), buf, len);
+               skb_put_data(skb, buf, len);
        }
        switch (CAPIMSG_CMD(skb->data))
        {
index b93a4e9a8d3449e4428e558a8c31c6d0014d8a16..8e9c34f33d8678c18d0dd78347fa197a0abf01bf 100644 (file)
@@ -201,7 +201,7 @@ hysdn_rx_netpkt(hysdn_card *card, unsigned char *buf, unsigned short len)
                return;
        }
        /* copy the data */
-       memcpy(skb_put(skb, len), buf, len);
+       skb_put_data(skb, buf, len);
 
        /* determine the used protocol */
        skb->protocol = eth_type_trans(skb, dev);
index 8aa158a091806fd7d3107ed56b8550198be7b9a0..9ce23cf3d7d2188109b7cd9fb9bef3fb0670a7db 100644 (file)
@@ -2258,8 +2258,7 @@ static void isdn_ppp_ccp_xmit_reset(struct ippp_struct *is, int proto,
 
        /* Now stuff remaining bytes */
        if (len) {
-               p = skb_put(skb, len);
-               memcpy(p, data, len);
+               p = skb_put_data(skb, data, len);
        }
 
        /* skb is now ready for xmit */
index ddd8207e4e54cf617e76a2f784bc56aeff76b22e..d30130c8d0f3d356b25aad643fc4c5736e24692e 100644 (file)
@@ -474,7 +474,7 @@ isdn_tty_senddown(modem_info *info)
                return;
        }
        skb_reserve(skb, skb_res);
-       memcpy(skb_put(skb, buflen), info->port.xmit_buf, buflen);
+       skb_put_data(skb, info->port.xmit_buf, buflen);
        info->xmit_count = 0;
 #ifdef CONFIG_ISDN_AUDIO
        if (info->vonline & 2) {
index 52827a80c51f4bc2528be2af0b5c9886eb36a1d5..8b74ce412524827c14333e4444e275ac4fdcc723 100644 (file)
@@ -421,7 +421,7 @@ isdn_v110_sync(isdn_v110_stream *v)
        }
        if ((skb = dev_alloc_skb(v->framelen + v->skbres))) {
                skb_reserve(skb, v->skbres);
-               memcpy(skb_put(skb, v->framelen), v->OfflineFrame, v->framelen);
+               skb_put_data(skb, v->OfflineFrame, v->framelen);
        }
        return skb;
 }
@@ -441,7 +441,7 @@ isdn_v110_idle(isdn_v110_stream *v)
        }
        if ((skb = dev_alloc_skb(v->framelen + v->skbres))) {
                skb_reserve(skb, v->skbres);
-               memcpy(skb_put(skb, v->framelen), v->OnlineFrame, v->framelen);
+               skb_put_data(skb, v->OnlineFrame, v->framelen);
        }
        return skb;
 }
@@ -486,7 +486,7 @@ isdn_v110_encode(isdn_v110_stream *v, struct sk_buff *skb)
        }
        skb_reserve(nskb, v->skbres + sizeof(int));
        if (skb->len == 0) {
-               memcpy(skb_put(nskb, v->framelen), v->OnlineFrame, v->framelen);
+               skb_put_data(nskb, v->OnlineFrame, v->framelen);
                *((int *)skb_push(nskb, sizeof(int))) = 0;
                return nskb;
        }
index ef9c8e4f1fa2900fc00ecc9adecedb7dd07a1cee..7ac7badb8f55b242a10f305436f4637ebbcd1f5b 100644 (file)
@@ -479,7 +479,7 @@ isdnloop_fake(isdnloop_card *card, char *s, int ch)
        }
        if (ch >= 0)
                sprintf(skb_put(skb, 3), "%02d;", ch);
-       memcpy(skb_put(skb, strlen(s)), s, strlen(s));
+       skb_put_data(skb, s, strlen(s));
        skb_queue_tail(&card->dqueue, skb);
        return 0;
 }
index 8e3aa002767b80a783884cfcffefbb09d018a9c1..d4b6f01a3f0eac4103b7961033a35d0273612ce7 100644 (file)
@@ -1595,8 +1595,7 @@ send_packet:
                                thh = mISDN_HEAD_P(txskb);
                                thh->prim = DL_DATA_REQ;
                                thh->id = 0;
-                               memcpy(skb_put(txskb, len), nskb->data + preload,
-                                      len);
+                               skb_put_data(txskb, nskb->data + preload, len);
                                /* queue (trigger later) */
                                skb_queue_tail(&dsp->sendq, txskb);
                        }
index 5eb380a2590394ba087e2f160281e1902112910f..7243a6746f8b099d79d3221def6dcfcf138a6f51 100644 (file)
@@ -176,7 +176,7 @@ l2up_create(struct layer2 *l2, u_int prim, int len, void *arg)
        hh->prim = prim;
        hh->id = (l2->ch.nr << 16) | l2->ch.addr;
        if (len)
-               memcpy(skb_put(skb, len), arg, len);
+               skb_put_data(skb, arg, len);
        err = l2->up->send(l2->up, skb);
        if (err) {
                printk(KERN_WARNING "%s: dev %s err=%d\n", __func__,
@@ -235,7 +235,7 @@ l2down_create(struct layer2 *l2, u_int prim, u_int id, int len, void *arg)
        hh->prim = prim;
        hh->id = id;
        if (len)
-               memcpy(skb_put(skb, len), arg, len);
+               skb_put_data(skb, arg, len);
        err = l2down_raw(l2, skb);
        if (err)
                dev_kfree_skb(skb);
@@ -640,7 +640,7 @@ send_uframe(struct layer2 *l2, struct sk_buff *skb, u_char cmd, u_char cr)
                        return;
                }
        }
-       memcpy(skb_put(skb, i), tmp, i);
+       skb_put_data(skb, tmp, i);
        enqueue_super(l2, skb);
 }
 
@@ -1125,7 +1125,7 @@ enquiry_cr(struct layer2 *l2, u_char typ, u_char cr, u_char pf)
                       mISDNDevName4ch(&l2->ch), __func__);
                return;
        }
-       memcpy(skb_put(skb, i), tmp, i);
+       skb_put_data(skb, tmp, i);
        enqueue_super(l2, skb);
 }
 
index 592f597d895181d0ce1e5dd697a7d37ab09f2ef3..908127efccf8ceb94ef2ab1ed7df4b17b26ce5b9 100644 (file)
@@ -312,7 +312,7 @@ teiup_create(struct manager *mgr, u_int prim, int len, void *arg)
        hh->prim = prim;
        hh->id = (mgr->ch.nr << 16) | mgr->ch.addr;
        if (len)
-               memcpy(skb_put(skb, len), arg, len);
+               skb_put_data(skb, arg, len);
        err = mgr->up->send(mgr->up, skb);
        if (err) {
                printk(KERN_WARNING "%s: err=%d\n", __func__, err);
index 9947b342633eec756ef64cfcd6b81d643105d5e5..bbaf0a8cae8b6b7916e18fc8fbb725b2dda58eea 100644 (file)
@@ -828,8 +828,7 @@ static void dvb_net_ule(struct net_device *dev, const u8 *buf, size_t buf_len)
 
                /* Copy data into our current skb. */
                h.how_much = min(h.priv->ule_sndu_remain, (int)h.ts_remain);
-               memcpy(skb_put(h.priv->ule_skb, h.how_much),
-                      h.from_where, h.how_much);
+               skb_put_data(h.priv->ule_skb, h.from_where, h.how_much);
                h.priv->ule_sndu_remain -= h.how_much;
                h.ts_remain -= h.how_much;
                h.from_where += h.how_much;
index 588e2d61c3b42d498b3863c4659b84fa4562024b..c67e055a12c9e9e005b9bba943424f25d06cb8d1 100644 (file)
@@ -442,7 +442,7 @@ static int fm_send_cmd(struct fmdev *fmdev, u8 fm_op, u16 type,     void *payload,
                fm_cb(skb)->fm_op = *((u8 *)payload + 2);
        }
        if (payload != NULL)
-               memcpy(skb_put(skb, payload_len), payload, payload_len);
+               skb_put_data(skb, payload, payload_len);
 
        fm_cb(skb)->completion = wait_completion;
        skb_queue_tail(&fmdev->tx_q, skb);
index 00051590e00f96470c6caabb3b13a08079c26178..eda8d407be2878776bea8b6d57fb8c461f416724 100644 (file)
@@ -262,7 +262,7 @@ void st_int_recv(void *disc_data,
        while (count) {
                if (st_gdata->rx_count) {
                        len = min_t(unsigned int, st_gdata->rx_count, count);
-                       memcpy(skb_put(st_gdata->rx_skb, len), ptr, len);
+                       skb_put_data(st_gdata->rx_skb, ptr, len);
                        st_gdata->rx_count -= len;
                        count -= len;
                        ptr += len;
index bf0d7708beac59e2723d774ceb4297b2e2700669..e74413f882ab180b01559b6face6ff32b6e87355 100644 (file)
@@ -152,7 +152,7 @@ static void kim_int_recv(struct kim_data_s *kim_gdata,
        while (count) {
                if (kim_gdata->rx_count) {
                        len = min_t(unsigned int, kim_gdata->rx_count, count);
-                       memcpy(skb_put(kim_gdata->rx_skb, len), ptr, len);
+                       skb_put_data(kim_gdata->rx_skb, ptr, len);
                        kim_gdata->rx_count -= len;
                        count -= len;
                        ptr += len;
index 7d7a3cec149a61241715c092a2fff02c0ce30fb0..b796db7dd621f9e3612e08b33e132cc94a8eaf15 100644 (file)
@@ -936,8 +936,7 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
        if (!skb)
                return;
 
-       data = skb_put(skb, size);
-       memcpy(data, &pkt, size);
+       data = skb_put_data(skb, &pkt, size);
 
        skb_reset_mac_header(skb);
        skb->network_header = skb->mac_header + ETH_HLEN;
index 71a7c3b44fdde3c3a7ede652a7dab681d577e6ce..4534326e20ac7bb2e752472cf413e4fd64d3d5e6 100644 (file)
@@ -454,8 +454,7 @@ static int cfhsi_rx_desc(struct cfhsi_desc *desc, struct cfhsi *cfhsi)
                }
                caif_assert(skb != NULL);
 
-               dst = skb_put(skb, len);
-               memcpy(dst, pfrm, len);
+               dst = skb_put_data(skb, pfrm, len);
 
                skb->protocol = htons(ETH_P_CAIF);
                skb_reset_mac_header(skb);
@@ -585,8 +584,7 @@ static int cfhsi_rx_pld(struct cfhsi_desc *desc, struct cfhsi *cfhsi)
                }
                caif_assert(skb != NULL);
 
-               dst = skb_put(skb, len);
-               memcpy(dst, pcffrm, len);
+               dst = skb_put_data(skb, pcffrm, len);
 
                skb->protocol = htons(ETH_P_CAIF);
                skb_reset_mac_header(skb);
index 76e1d3545105e8abb9e2ef644e03fab0d2f5b243..5c57be2082bacf484d1621c7bc4aac09a3fb1bf2 100644 (file)
@@ -198,8 +198,7 @@ static void ldisc_receive(struct tty_struct *tty, const u8 *data,
        skb = netdev_alloc_skb(ser->dev, count+1);
        if (skb == NULL)
                return;
-       p = skb_put(skb, count);
-       memcpy(p, data, count);
+       p = skb_put_data(skb, data, count);
 
        skb->protocol = htons(ETH_P_CAIF);
        skb_reset_mac_header(skb);
index fc21afe852b9817a2bdd242fc371834c515213dd..24a5f5ca2037d91c05ea36782adeb63315726cb5 100644 (file)
@@ -548,8 +548,7 @@ int cfspi_rxfrm(struct cfspi *cfspi, u8 *buf, size_t len)
                skb = netdev_alloc_skb(cfspi->ndev, pkt_len + 1);
                caif_assert(skb != NULL);
 
-               dst = skb_put(skb, pkt_len);
-               memcpy(dst, src, pkt_len);
+               dst = skb_put_data(skb, src, pkt_len);
                src += pkt_len;
 
                skb->protocol = htons(ETH_P_CAIF);
index 1794ea0420b794e76c75fafdede7e1a73ca86868..c3d104feee13b96fa004c4ae135238517456941a 100644 (file)
@@ -242,7 +242,7 @@ static struct sk_buff *cfv_alloc_and_copy_skb(int *err,
 
        skb_reserve(skb, cfv->rx_hr + pad_len);
 
-       memcpy(skb_put(skb, cfpkt_len), frm + cfv->rx_hr, cfpkt_len);
+       skb_put_data(skb, frm + cfv->rx_hr, cfpkt_len);
        return skb;
 }
 
index 6a6e896e52fa09415ae72715602fd4713e28f899..5d067c1b987f8d84dd106c58350e7441dffc66aa 100644 (file)
@@ -216,8 +216,7 @@ static void slc_bump(struct slcan *sl)
        can_skb_prv(skb)->ifindex = sl->dev->ifindex;
        can_skb_prv(skb)->skbcnt = 0;
 
-       memcpy(skb_put(skb, sizeof(struct can_frame)),
-              &cf, sizeof(struct can_frame));
+       skb_put_data(skb, &cf, sizeof(struct can_frame));
 
        sl->dev->stats.rx_packets++;
        sl->dev->stats.rx_bytes += cf.can_dlc;
index e7b1fa56b2904b68d01051640638f9f969557a78..c5987f518cb29563b9ebc5666236247ddda44725 100644 (file)
@@ -1370,9 +1370,9 @@ static int boomerang_rx(struct net_device *dev)
                            (skb = netdev_alloc_skb(dev, pkt_len + 4)) != NULL) {
                                skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
                                /* 'skb_put()' points to the start of sk_buff data area. */
-                               memcpy(skb_put(skb, pkt_len),
-                                      isa_bus_to_virt(vp->rx_ring[entry].
-                                                  addr), pkt_len);
+                               skb_put_data(skb,
+                                            isa_bus_to_virt(vp->rx_ring[entry].addr),
+                                            pkt_len);
                                rx_copy++;
                        } else {
                                void *temp;
index 14cff6017756c7db50669a582d1a920da26e7842..3b516ebeeddbbc6943f85e73263931af08e0b3d3 100644 (file)
@@ -2628,9 +2628,8 @@ boomerang_rx(struct net_device *dev)
                                skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
                                pci_dma_sync_single_for_cpu(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
                                /* 'skb_put()' points to the start of sk_buff data area. */
-                               memcpy(skb_put(skb, pkt_len),
-                                          vp->rx_skbuff[entry]->data,
-                                          pkt_len);
+                               skb_put_data(skb, vp->rx_skbuff[entry]->data,
+                                            pkt_len);
                                pci_dma_sync_single_for_device(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
                                vp->rx_copy++;
                        } else {
index d8e133ced7b8a026682ee5f60396e380b4fa5ee6..4309be3724ad4548b871946c934206eaa2d2d3df 100644 (file)
@@ -807,7 +807,8 @@ static int greth_rx(struct net_device *dev, int limit)
                                if (netif_msg_pktdata(greth))
                                        greth_print_rx_packet(phys_to_virt(dma_addr), pkt_len);
 
-                               memcpy(skb_put(skb, pkt_len), phys_to_virt(dma_addr), pkt_len);
+                               skb_put_data(skb, phys_to_virt(dma_addr),
+                                            pkt_len);
 
                                skb->protocol = eth_type_trans(skb, dev);
                                dev->stats.rx_bytes += pkt_len;
index 87a11b9f0ea5beab9a97493e23ae901f6d390346..54eff90e2f02c0ffcaae31b9539e20d3dd579961 100644 (file)
@@ -2282,7 +2282,7 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter)
 
        adapter->netdev->stats.rx_bytes += rfd->len;
 
-       memcpy(skb_put(skb, rfd->len), fbr->virt[buff_index], rfd->len);
+       skb_put_data(skb, fbr->virt[buff_index], rfd->len);
 
        skb->protocol = eth_type_trans(skb, adapter->netdev);
        skb->ip_summed = CHECKSUM_NONE;
index 857df9c45f04ddc9829b83c8b2744e2306cb2224..f17a160dbff285afd37cf6140bd1790d47f93bd6 100644 (file)
@@ -663,7 +663,7 @@ static void mace_dma_rx_frame(struct net_device *dev, struct mace_frame *mf)
                        return;
                }
                skb_reserve(skb, 2);
-               memcpy(skb_put(skb, frame_length), mf->data, frame_length);
+               skb_put_data(skb, mf->data, frame_length);
 
                skb->protocol = eth_type_trans(skb, dev);
                netif_rx(skb);
index 5711fbbd6ae34d59a9295c6ac136af6f2de89d78..041cfb7952f81d71278279454a394c9754e0fb97 100644 (file)
@@ -251,7 +251,7 @@ static void nb8800_receive(struct net_device *dev, unsigned int i,
 
        if (len <= RX_COPYBREAK) {
                dma_sync_single_for_cpu(&dev->dev, dma, len, DMA_FROM_DEVICE);
-               memcpy(skb_put(skb, len), data, len);
+               skb_put_data(skb, data, len);
                dma_sync_single_for_device(&dev->dev, dma, len,
                                           DMA_FROM_DEVICE);
        } else {
@@ -264,7 +264,7 @@ static void nb8800_receive(struct net_device *dev, unsigned int i,
                }
 
                dma_unmap_page(&dev->dev, dma, RX_BUF_SIZE, DMA_FROM_DEVICE);
-               memcpy(skb_put(skb, RX_COPYHDR), data, RX_COPYHDR);
+               skb_put_data(skb, data, RX_COPYHDR);
                skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
                                offset + RX_COPYHDR, len - RX_COPYHDR,
                                RX_BUF_SIZE);
index 91f7492623d3f1d614afeb7f525ecfb491e5965e..4b0168bcbc8adf416c3880b763f70b5a2a13a51b 100644 (file)
@@ -2992,7 +2992,7 @@ static void at91ether_rx(struct net_device *dev)
                skb = netdev_alloc_skb(dev, pktlen + 2);
                if (skb) {
                        skb_reserve(skb, 2);
-                       memcpy(skb_put(skb, pktlen), p_recv, pktlen);
+                       skb_put_data(skb, p_recv, pktlen);
 
                        skb->protocol = eth_type_trans(skb, dev);
                        dev->stats.rx_packets++;
index bf483932ff25021652ecf44e550426713c3af1d8..4b3507972243cf3104332350102d993d9d6c2166 100644 (file)
@@ -443,8 +443,8 @@ static inline void octeon_fast_packet_next(struct octeon_droq *droq,
                                           int copy_len,
                                           int idx)
 {
-       memcpy(skb_put(nicbuf, copy_len),
-              get_rbd(droq->recv_buf_list[idx].buffer), copy_len);
+       skb_put_data(nicbuf, get_rbd(droq->recv_buf_list[idx].buffer),
+                    copy_len);
 }
 
 /**
index da5b58b853e2947258551ebb962f30b2005746d0..410a0a95130b4ed1b292dcc628ae820c164146da 100644 (file)
@@ -450,11 +450,10 @@ skip_this_frame:
 
        if (bp + length > lp->end_dma_buff) {
                int semi_cnt = lp->end_dma_buff - bp;
-               memcpy(skb_put(skb, semi_cnt), bp, semi_cnt);
-               memcpy(skb_put(skb, length - semi_cnt), lp->dma_buff,
-                      length - semi_cnt);
+               skb_put_data(skb, bp, semi_cnt);
+               skb_put_data(skb, lp->dma_buff, length - semi_cnt);
        } else {
-               memcpy(skb_put(skb, length), bp, length);
+               skb_put_data(skb, bp, length);
        }
        bp += (length + 3) & ~3;
        if (bp >= lp->end_dma_buff)
index fd6bcf024729318db6a85300bfbcc73e2cbd0bc6..47be5018d35d3d60a6f533245e3909c8d8ff3965 100644 (file)
@@ -3624,10 +3624,10 @@ de4x5_alloc_rx_buff(struct net_device *dev, int index, int len)
     skb_reserve(p, 2);                                /* Align */
     if (index < lp->rx_old) {                          /* Wrapped buffer */
        short tlen = (lp->rxRingSize - lp->rx_old) * RX_BUFF_SZ;
-       memcpy(skb_put(p,tlen),lp->rx_bufs + lp->rx_old * RX_BUFF_SZ,tlen);
-       memcpy(skb_put(p,len-tlen),lp->rx_bufs,len-tlen);
+       skb_put_data(p, lp->rx_bufs + lp->rx_old * RX_BUFF_SZ, tlen);
+       skb_put_data(p, lp->rx_bufs, len - tlen);
     } else {                                           /* Linear buffer */
-       memcpy(skb_put(p,len),lp->rx_bufs + lp->rx_old * RX_BUFF_SZ,len);
+       skb_put_data(p, lp->rx_bufs + lp->rx_old * RX_BUFF_SZ, len);
     }
 
     return p;
index ba6ae24acf62238e22c162f9ee294159f41d5cc0..8df80880ecaaa0f15e06aa7c93db58d108f30872 100644 (file)
@@ -218,9 +218,9 @@ int tulip_poll(struct napi_struct *napi, int budget)
                                                         pkt_len);
                                        skb_put(skb, pkt_len);
 #else
-                                       memcpy(skb_put(skb, pkt_len),
-                                              tp->rx_buffers[entry].skb->data,
-                                              pkt_len);
+                                       skb_put_data(skb,
+                                                    tp->rx_buffers[entry].skb->data,
+                                                    pkt_len);
 #endif
                                        pci_dma_sync_single_for_device(tp->pdev,
                                                                      tp->rx_buffers[entry].mapping,
@@ -444,9 +444,9 @@ static int tulip_rx(struct net_device *dev)
                                                 pkt_len);
                                skb_put(skb, pkt_len);
 #else
-                               memcpy(skb_put(skb, pkt_len),
-                                      tp->rx_buffers[entry].skb->data,
-                                      pkt_len);
+                               skb_put_data(skb,
+                                            tp->rx_buffers[entry].skb->data,
+                                            pkt_len);
 #endif
                                pci_dma_sync_single_for_device(tp->pdev,
                                                               tp->rx_buffers[entry].mapping,
index 8d98b259d1baa21da41a278b4614fd2d4f4b749d..7fc248efc4baa4e259945978e741d767a4aa1b63 100644 (file)
@@ -864,9 +864,9 @@ static void uli526x_rx_packet(struct net_device *dev, struct uli526x_board_info
                                        skb = new_skb;
                                        /* size less than COPY_SIZE, allocate a rxlen SKB */
                                        skb_reserve(skb, 2); /* 16byte align */
-                                       memcpy(skb_put(skb, rxlen),
-                                              skb_tail_pointer(rxptr->rx_skb_ptr),
-                                              rxlen);
+                                       skb_put_data(skb,
+                                                    skb_tail_pointer(rxptr->rx_skb_ptr),
+                                                    rxlen);
                                        uli526x_reuse_skb(db, rxptr->rx_skb_ptr);
                                } else
                                        skb_put(skb, rxlen);
index 278f139f2a22355dbb49674b28f6f54609c195cc..4ee042c034a199288aa0c67a32d2a8a4c761cf29 100644 (file)
@@ -223,7 +223,7 @@ static void ec_bhf_process_rx(struct ec_bhf_priv *priv)
 
                skb = netdev_alloc_skb_ip_align(priv->net_dev, pkt_size);
                if (skb) {
-                       memcpy(skb_put(skb, pkt_size), data, pkt_size);
+                       skb_put_data(skb, data, pkt_size);
                        skb->protocol = eth_type_trans(skb, priv->net_dev);
                        priv->stat_rx_bytes += pkt_size;
 
index 610f9c07c21df4e3c96ff141e2e5f40b381db6e8..e92859dab7aedee0f9be5cb8ca612751b4956658 100644 (file)
@@ -1711,8 +1711,8 @@ static int netdev_rx(struct net_device *dev)
                                        np->cur_rx->skbuff->data, pkt_len);
                                skb_put(skb, pkt_len);
 #else
-                               memcpy(skb_put(skb, pkt_len),
-                                       np->cur_rx->skbuff->data, pkt_len);
+                               skb_put_data(skb, np->cur_rx->skbuff->data,
+                                            pkt_len);
 #endif
                                pci_dma_sync_single_for_device(np->pci_dev,
                                                               np->cur_rx->buffer,
index 94588384253300a981f2c8b1564111261398685c..d719668a6684aa5f9a8b93b8a991a08b28cb004a 100644 (file)
@@ -809,7 +809,8 @@ memory_squeeze:
                                if (!rx_in_place) {
                                        /* 16 byte align the data fields */
                                        skb_reserve(skb, 2);
-                                       memcpy(skb_put(skb,pkt_len), rbd->v_data, pkt_len);
+                                       skb_put_data(skb, rbd->v_data,
+                                                    pkt_len);
                                }
                                skb->protocol=eth_type_trans(skb,dev);
                                skb->len = pkt_len;
index e86773325cbec65927e946e9992faf493841042a..8449c58f01fd6571c101f6d76a360c77237565fe 100644 (file)
@@ -727,7 +727,8 @@ memory_squeeze:
                                        dma_sync_single_for_cpu(dev->dev.parent,
                                                                (dma_addr_t)SWAP32(rbd->b_data),
                                                                PKT_BUF_SZ, DMA_FROM_DEVICE);
-                                       memcpy(skb_put(skb, pkt_len), rbd->v_data, pkt_len);
+                                       skb_put_data(skb, rbd->v_data,
+                                                    pkt_len);
                                        dma_sync_single_for_device(dev->dev.parent,
                                                                   (dma_addr_t)SWAP32(rbd->b_data),
                                                                   PKT_BUF_SZ, DMA_FROM_DEVICE);
index bd8b05fe82581f7af25bf2d39a88d6f5e56089f8..98375e1e1185e7b8136515d0d3e2a90464495ccd 100644 (file)
@@ -4345,7 +4345,7 @@ static struct sk_buff *e1000_copybreak(struct e1000_adapter *adapter,
        dma_sync_single_for_cpu(&adapter->pdev->dev, buffer_info->dma,
                                length, DMA_FROM_DEVICE);
 
-       memcpy(skb_put(skb, length), data, length);
+       skb_put_data(skb, data, length);
 
        return skb;
 }
index d297011b535dc812beba6765033a3349abffb0a9..0aab74c2a209a7f8e0aaa4a8e48d481e831df771 100644 (file)
@@ -1976,9 +1976,8 @@ err_drop_frame:
                                                      MVNETA_MH_SIZE + NET_SKB_PAD,
                                                      rx_bytes,
                                                      DMA_FROM_DEVICE);
-                       memcpy(skb_put(skb, rx_bytes),
-                              data + MVNETA_MH_SIZE + NET_SKB_PAD,
-                              rx_bytes);
+                       skb_put_data(skb, data + MVNETA_MH_SIZE + NET_SKB_PAD,
+                                    rx_bytes);
 
                        skb->protocol = eth_type_trans(skb, dev);
                        mvneta_rx_csum(pp, rx_status, skb);
@@ -2103,9 +2102,8 @@ err_drop_frame:
                                                      MVNETA_MH_SIZE + NET_SKB_PAD,
                                                      rx_bytes,
                                                      DMA_FROM_DEVICE);
-                       memcpy(skb_put(skb, rx_bytes),
-                              data + MVNETA_MH_SIZE + NET_SKB_PAD,
-                              rx_bytes);
+                       skb_put_data(skb, data + MVNETA_MH_SIZE + NET_SKB_PAD,
+                                    rx_bytes);
 
                        skb->protocol = eth_type_trans(skb, dev);
                        mvneta_rx_csum(pp, rx_status, skb);
index ee1c78abab0bf323c6aed4b253376dfe22e6314e..e798fbe086001acc3b4e36a6970058b5c6fda078 100644 (file)
@@ -5020,8 +5020,7 @@ static inline int rx_proc(struct net_device *dev, struct ksz_hw* hw,
                 */
                skb_reserve(skb, 2);
 
-               memcpy(skb_put(skb, packet_len),
-                       dma_buf->skb->data, packet_len);
+               skb_put_data(skb, dma_buf->skb->data, packet_len);
        } while (0);
 
        skb->protocol = eth_type_trans(skb, dev);
index 9c7ffd649e9a460a4519a0cecd7a3e9367154117..828bfd93cb54a5ab200d2e47913899a99475679e 100644 (file)
@@ -959,11 +959,10 @@ static int __lpc_handle_recv(struct net_device *ndev, int budget)
                        if (!skb) {
                                ndev->stats.rx_dropped++;
                        } else {
-                               prdbuf = skb_put(skb, len);
-
                                /* Copy packet from buffer */
-                               memcpy(prdbuf, pldat->rx_buff_v +
-                                       rxconsidx * ENET_MAXF_SIZE, len);
+                               prdbuf = skb_put_data(skb,
+                                                     pldat->rx_buff_v + rxconsidx * ENET_MAXF_SIZE,
+                                                     len);
 
                                /* Pass to upper layer */
                                skb->protocol = eth_type_trans(skb, ndev);
index 892eb98290f6f8a9ea9dc2ddf023555e6f74b0c3..6fc854b120b03520783e16e750d30466fddbdffa 100644 (file)
@@ -1079,8 +1079,7 @@ static struct sk_buff *qede_rx_allocate_skb(struct qede_dev *edev,
         * re-use the already allcoated & mapped memory.
         */
        if (len + pad <= edev->rx_copybreak) {
-               memcpy(skb_put(skb, len),
-                      page_address(page) + offset, len);
+               skb_put_data(skb, page_address(page) + offset, len);
                qede_reuse_page(rxq, bd);
                goto out;
        }
index 1188d420fe539912e6b2eb8656124625f1ae6f34..9feec70094435e19ee039f18ea430291d9f7d1a0 100644 (file)
@@ -1577,7 +1577,7 @@ static void ql_process_mac_rx_page(struct ql_adapter *qdev,
                rx_ring->rx_dropped++;
                goto err_out;
        }
-       memcpy(skb_put(skb, hlen), addr, hlen);
+       skb_put_data(skb, addr, hlen);
        netif_printk(qdev, rx_status, KERN_DEBUG, qdev->ndev,
                     "%d bytes of headers and data in large. Chain page to new skb and pull tail.\n",
                     length);
@@ -1654,7 +1654,7 @@ static void ql_process_mac_rx_skb(struct ql_adapter *qdev,
                                    dma_unmap_len(sbq_desc, maplen),
                                    PCI_DMA_FROMDEVICE);
 
-       memcpy(skb_put(new_skb, length), skb->data, length);
+       skb_put_data(new_skb, skb->data, length);
 
        pci_dma_sync_single_for_device(qdev->pdev,
                                       dma_unmap_addr(sbq_desc, mapaddr),
@@ -1817,8 +1817,7 @@ static struct sk_buff *ql_build_rx_skb(struct ql_adapter *qdev,
                                                    dma_unmap_len
                                                    (sbq_desc, maplen),
                                                    PCI_DMA_FROMDEVICE);
-                       memcpy(skb_put(skb, length),
-                              sbq_desc->p.skb->data, length);
+                       skb_put_data(skb, sbq_desc->p.skb->data, length);
                        pci_dma_sync_single_for_device(qdev->pdev,
                                                       dma_unmap_addr
                                                       (sbq_desc,
index 751c81848f3557c2c019f3d3f59e14a9fb247034..c07fd594fe71a0009ab76a57e1f9ce9c25661aa3 100644 (file)
@@ -795,12 +795,12 @@ static void _sc92031_rx_tasklet(struct net_device *dev)
                }
 
                if ((rx_ring_offset + pkt_size) > RX_BUF_LEN) {
-                       memcpy(skb_put(skb, RX_BUF_LEN - rx_ring_offset),
-                               rx_ring + rx_ring_offset, RX_BUF_LEN - rx_ring_offset);
-                       memcpy(skb_put(skb, pkt_size - (RX_BUF_LEN - rx_ring_offset)),
-                               rx_ring, pkt_size - (RX_BUF_LEN - rx_ring_offset));
+                       skb_put_data(skb, rx_ring + rx_ring_offset,
+                                    RX_BUF_LEN - rx_ring_offset);
+                       skb_put_data(skb, rx_ring,
+                                    pkt_size - (RX_BUF_LEN - rx_ring_offset));
                } else {
-                       memcpy(skb_put(skb, pkt_size), rx_ring + rx_ring_offset, pkt_size);
+                       skb_put_data(skb, rx_ring + rx_ring_offset, pkt_size);
                }
 
                skb->protocol = eth_type_trans(skb, dev);
index b56e07fa44a8904c477890f4947a133056935934..750954be5a7403d0a6c752649866b43546354f88 100644 (file)
@@ -1156,8 +1156,7 @@ static int fjes_poll(struct napi_struct *napi, int budget)
                                hw->ep_shm_info[cur_epid].net_stats
                                                         .rx_errors += 1;
                        } else {
-                               memcpy(skb_put(skb, frame_len),
-                                      frame, frame_len);
+                               skb_put_data(skb, frame, frame_len);
                                skb->protocol = eth_type_trans(skb, netdev);
                                skb->ip_summed = CHECKSUM_UNNECESSARY;
 
index 4a40a3d825b41c2758a086a40cb216d6165f1cfa..aec6c26563cff70e5ce099a202c169a5a9b126e4 100644 (file)
@@ -298,7 +298,7 @@ static void ax_bump(struct mkiss *ax)
                return;
        }
 
-       memcpy(skb_put(skb,count), ax->rbuff, count);
+       skb_put_data(skb, ax->rbuff, count);
        skb->protocol = ax25_type_trans(skb, ax->dev);
        netif_rx(skb);
        ax->dev->stats.rx_packets++;
index 1ce6239a484952739627988f307fc80da17c9eb5..7683fd544344a9778bb2964b7b77bca6289a32b3 100644 (file)
@@ -962,8 +962,8 @@ static void rx_int(struct net_device *dev, u32 rxlimit, u32 index)
                                                                    pkt_len,
                                                                    PCI_DMA_FROMDEVICE);
 
-                                       memcpy(skb_put(skb, pkt_len),
-                                              rx_skb->data, pkt_len);
+                                       skb_put_data(skb, rx_skb->data,
+                                                    pkt_len);
 
                                        pci_dma_sync_single_for_device(rrpriv->pci_dev,
                                                                       desc->addr.addrlo,
index b65a97ecb78ead138ab4df32d24c56a35ceef58e..9a6c5864bc047ba94a0a59fdc03032a5385005d9 100644 (file)
@@ -593,7 +593,7 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
         * Copy to skb. This copy is needed here since the memory pointed by
         * hv_netvsc_packet cannot be deallocated
         */
-       memcpy(skb_put(skb, buflen), data, buflen);
+       skb_put_data(skb, data, buflen);
 
        skb->protocol = eth_type_trans(skb, net);
 
index 76ba7ecfe14290c7800879c0f80b284f54299ca7..548d9d026a85e2ff0e329f0f61454f555ab1a522 100644 (file)
@@ -723,7 +723,7 @@ at86rf230_rx_read_frame_complete(void *context)
                return;
        }
 
-       memcpy(skb_put(skb, len), buf + 2, len);
+       skb_put_data(skb, buf + 2, len);
        ieee802154_rx_irqsafe(lp->hw, skb, lqi);
        kfree(ctx);
 }
index 7a218549c80aa0f9384d3d3b400907716c81184c..a626c539fb17ffcb78f1508566aa90fbbe99481d 100644 (file)
@@ -1875,7 +1875,7 @@ static int ca8210_skb_rx(
 copy_payload:
        /* Add <msdulen> bytes of space to the back of the buffer */
        /* Copy msdu to skb */
-       memcpy(skb_put(skb, msdulen), &data_ind[29], msdulen);
+       skb_put_data(skb, &data_ind[29], msdulen);
 
        ieee802154_rx_irqsafe(hw, skb, mpdulinkquality);
        return 0;
index bd63289c55e8fcb68e9e371712ad1fdfc3521a43..7d334963dc085c14fba2aa4508c8ea23c87b40b1 100644 (file)
@@ -774,7 +774,7 @@ static void mrf24j40_handle_rx_read_buf_complete(void *context)
                return;
        }
 
-       memcpy(skb_put(skb, len), rx_local_buf, len);
+       skb_put_data(skb, rx_local_buf, len);
        ieee802154_rx_irqsafe(devrec->hw, skb, 0);
 
 #ifdef DEBUG
index 23ed89ae5ddce96ff3dd3e5c37343e6c14e9e979..19a55cba6bebe23fbf943eefd86f9af9c6f7d71b 100644 (file)
@@ -1459,7 +1459,7 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self)
        /* Make sure IP header gets aligned */
        skb_reserve(skb, 1);
 
-       memcpy(skb_put(skb, len), self->rx_buff.data, len);
+       skb_put_data(skb, self->rx_buff.data, len);
        self->netdev->stats.rx_packets++;
        self->netdev->stats.rx_bytes += len;
 
index 15b920086251633e2ee0ee0b26ba0046859e5299..6638784c082ed67c6abf66dcd5356c5cddb384f9 100644 (file)
@@ -578,7 +578,7 @@ static int vlsi_process_rx(struct vlsi_ring *r, struct ring_descr *rd)
        skb = rd->skb;
        rd->skb = NULL;
        skb->dev = ndev;
-       memcpy(skb_put(skb,len), rd->buf, len);
+       skb_put_data(skb, rd->buf, len);
        skb_reset_mac_header(skb);
        if (in_interrupt())
                netif_rx(skb);
index feb9569e33456b7fd73ed03a826d693506dd0d81..32c72db654e22fc054bb9cb8ba91ff9c1e2ee1ae 100644 (file)
@@ -894,8 +894,7 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
                                /* packet overflowed MRU */
                                ap->state |= SC_TOSS;
                        } else {
-                               sp = skb_put(skb, n);
-                               memcpy(sp, buf, n);
+                               sp = skb_put_data(skb, buf, n);
                                if (ap->state & SC_ESCAPE) {
                                        sp[0] ^= PPP_TRANS;
                                        ap->state &= ~SC_ESCAPE;
index 9ae53986cb4a5c3a4b929a854dc412f15bbe1cfe..ce2300c0bcbff1aba43592025c8548d6cb1aae07 100644 (file)
@@ -697,8 +697,7 @@ ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
                goto err;
        }
 
-       p = skb_put(skb, count);
-       memcpy(p, buf, count);
+       p = skb_put_data(skb, buf, count);
 
        /* strip address/control field if present */
        p = skb->data;
index 74b907206aa749d894531005716a0c6dd3d0ec1f..436dd78c396a7a95e2aa6046555f864d0e2c2637 100644 (file)
@@ -364,7 +364,7 @@ static void sl_bump(struct slip *sl)
                return;
        }
        skb->dev = dev;
-       memcpy(skb_put(skb, count), sl->rbuff, count);
+       skb_put_data(skb, sl->rbuff, count);
        skb_reset_mac_header(skb);
        skb->protocol = htons(ETH_P_IP);
        netif_rx_ni(skb);
index 125cff57c759e40f50337fb1c5887f77c0c78090..90facc5ecab0e0db356c175419c21fe87e26a3d9 100644 (file)
@@ -167,8 +167,8 @@ int asix_rx_fixup_internal(struct usbnet *dev, struct sk_buff *skb,
                }
 
                if (rx->ax_skb) {
-                       data = skb_put(rx->ax_skb, copy_length);
-                       memcpy(data, skb->data + offset, copy_length);
+                       data = skb_put_data(rx->ax_skb, skb->data + offset,
+                                           copy_length);
                        if (!rx->remaining)
                                usbnet_skb_return(dev, rx->ax_skb);
                }
index c7a350bbaaa7c881a831ec8ed7b4b59dd83c6de9..2952cb57099696fdaa3a42ad532e1af7693780e9 100644 (file)
@@ -162,7 +162,7 @@ static void rx_complete(struct urb *req)
                        skb = pnd->rx_skb = netdev_alloc_skb(dev, 12);
                        if (likely(skb)) {
                                /* Can't use pskb_pull() on page in IRQ */
-                               memcpy(skb_put(skb, 1), page_address(page), 1);
+                               skb_put_data(skb, page_address(page), 1);
                                skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
                                                page, 1, req->actual_length,
                                                PAGE_SIZE);
index a6b997cffd3b6e4c4f039a3d3dee5f386bb17e48..18fa45fc979b63810d993c9ca47a65b2009c5fb4 100644 (file)
@@ -399,7 +399,7 @@ static struct sk_buff *cdc_mbim_process_dgram(struct usbnet *dev, u8 *buf, size_
        memcpy(eth_hdr(skb)->h_dest, dev->net->dev_addr, ETH_ALEN);
 
        /* add datagram */
-       memcpy(skb_put(skb, len), buf, len);
+       skb_put_data(skb, buf, len);
 
        /* map MBIM session to VLAN */
        if (tci)
index 7f02954772c6e39a5bd30a71bfd8b2151d49e62e..8a4c8a1b9dd31ca7d172268fb9426fcad59e2180 100644 (file)
@@ -1180,7 +1180,7 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign)
                ndp16->dpe16[index].wDatagramLength = cpu_to_le16(skb->len);
                ndp16->dpe16[index].wDatagramIndex = cpu_to_le16(skb_out->len);
                ndp16->wLength = cpu_to_le16(ndplen + sizeof(struct usb_cdc_ncm_dpe16));
-               memcpy(skb_put(skb_out, skb->len), skb->data, skb->len);
+               skb_put_data(skb_out, skb->data, skb->len);
                ctx->tx_curr_frame_payload += skb->len; /* count real tx payload data */
                dev_kfree_skb_any(skb);
                skb = NULL;
@@ -1229,7 +1229,7 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign)
                nth16 = (struct usb_cdc_ncm_nth16 *)skb_out->data;
                cdc_ncm_align_tail(skb_out, ctx->tx_ndp_modulus, 0, ctx->tx_max);
                nth16->wNdpIndex = cpu_to_le16(skb_out->len);
-               memcpy(skb_put(skb_out, ctx->max_ndp_size), ctx->delayed_ndp16, ctx->max_ndp_size);
+               skb_put_data(skb_out, ctx->delayed_ndp16, ctx->max_ndp_size);
 
                /* Zero out delayed NDP - signature checking will naturally fail. */
                ndp16 = memset(ctx->delayed_ndp16, 0, ctx->max_ndp_size);
@@ -1497,7 +1497,7 @@ next_ndp:
                        skb = netdev_alloc_skb_ip_align(dev->net,  len);
                        if (!skb)
                                goto error;
-                       memcpy(skb_put(skb, len), skb_in->data + offset, len);
+                       skb_put_data(skb, skb_in->data + offset, len);
                        usbnet_skb_return(dev, skb);
                        payload += len; /* count payload bytes in this NTB */
                }
index 1cc24e6f23e2528150a3e9a660e134732e5cd988..29276e54bb8ba731f2bb5baa5bf9dce24531de3d 100644 (file)
@@ -121,8 +121,7 @@ static int genelink_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
                if (gl_skb) {
 
                        // copy the packet data to the new skb
-                       memcpy(skb_put(gl_skb, size),
-                                       packet->packet_data, size);
+                       skb_put_data(gl_skb, packet->packet_data, size);
                        usbnet_skb_return(dev, gl_skb);
                }
 
index 00067a0c51ca45b736920a3c56ee42cb24b08271..908ada4ca21c97ac96748c16bd77b5eb2b48797e 100644 (file)
@@ -911,11 +911,9 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt,
 
                                /* Copy what we got so far. make room for iphdr
                                 * after tail. */
-                               tmp_rx_buf =
-                                   skb_put(odev->skb_rx_buf,
-                                           sizeof(struct iphdr));
-                               memcpy(tmp_rx_buf, (char *)&(odev->rx_ip_hdr),
-                                      sizeof(struct iphdr));
+                               tmp_rx_buf = skb_put_data(odev->skb_rx_buf,
+                                                         (char *)&(odev->rx_ip_hdr),
+                                                         sizeof(struct iphdr));
 
                                /* ETH_HLEN */
                                odev->rx_buf_size = sizeof(struct iphdr);
@@ -934,8 +932,9 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt,
                        /* Copy the rest of the bytes that are left in the
                         * buffer into the waiting sk_buf. */
                        /* Make room for temp_bytes after tail. */
-                       tmp_rx_buf = skb_put(odev->skb_rx_buf, temp_bytes);
-                       memcpy(tmp_rx_buf, ip_pkt + buffer_offset, temp_bytes);
+                       tmp_rx_buf = skb_put_data(odev->skb_rx_buf,
+                                                 ip_pkt + buffer_offset,
+                                                 temp_bytes);
 
                        odev->rx_buf_missing -= temp_bytes;
                        count -= temp_bytes;
index 76465b117b72aaf0c2fdd36f3d78b15eed204b0e..0f213ea22c75b149822821ba7ea094b286faea7e 100644 (file)
@@ -253,7 +253,7 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
                return;
        }
 
-       memcpy(skb_put(skb, len), buf, len);
+       skb_put_data(skb, buf, len);
        skb->dev = dev->net;
        skb->protocol = eth_type_trans(skb, dev->net);
 
index 5714107533bb4292b94c85d064726ac4f89f496b..d633492bf9ebd87eb378a38bf1907b66ff31b86e 100644 (file)
@@ -135,7 +135,7 @@ static int vl600_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
                }
 
                buf = s->current_rx_buf;
-               memcpy(skb_put(buf, skb->len), skb->data, skb->len);
+               skb_put_data(buf, skb->data, skb->len);
        } else if (skb->len < 4) {
                netif_err(dev, ifup, dev->net, "Frame too short\n");
                dev->net->stats.rx_length_errors++;
index 32a22f4e8356422ba144a3e3485810537afaad2c..ffd229ec835234da94ae0e6bb0558dda1d00149b 100644 (file)
@@ -188,7 +188,7 @@ static int qmimux_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
                        goto skip;
                }
 
-               memcpy(skb_put(skbn, len), skb->data + offset, len);
+               skb_put_data(skbn, skb->data + offset, len);
                if (netif_rx(skbn) != NET_RX_SUCCESS)
                        return 0;
 
index 1f8c15cb63b0174ba97503b24c8a1238f06ab100..6bacbd2f0eca51bfcedb7a8cd448f95d9d32232b 100644 (file)
@@ -305,7 +305,7 @@ static struct sk_buff *page_to_skb(struct virtnet_info *vi,
        copy = len;
        if (copy > skb_tailroom(skb))
                copy = skb_tailroom(skb);
-       memcpy(skb_put(skb, copy), p, copy);
+       skb_put_data(skb, p, copy);
 
        len -= copy;
        offset += copy;
index 33265eb50420eee1f0cbef33c9d0f0e31889daa0..bd46b2552980878c1cb67d222428e320ae5d63ef 100644 (file)
@@ -857,7 +857,7 @@ fst_rx_dma_complete(struct fst_card_info *card, struct fst_port_info *port,
 
        dbg(DBG_TX, "fst_rx_dma_complete\n");
        pi = port->index;
-       memcpy(skb_put(skb, len), card->rx_dma_handle_host, len);
+       skb_put_data(skb, card->rx_dma_handle_host, len);
 
        /* Reset buffer descriptor */
        FST_WRB(card, rxDescrRing[pi][rxp].bits, DMA_OWN);
index 47fdb87d3567ce8ecb1f6dfc04d7f97884c57d8a..f5b4ad45831a6ab8d26984397b3448a426009883 100644 (file)
@@ -234,9 +234,9 @@ static void ppp_tx_cp(struct net_device *dev, u16 pid, u8 code,
        cp->len = htons(sizeof(struct cp_header) + magic_len + len);
 
        if (magic_len)
-               memcpy(skb_put(skb, magic_len), &magic, magic_len);
+               skb_put_data(skb, &magic, magic_len);
        if (len)
-               memcpy(skb_put(skb, len), data, len);
+               skb_put_data(skb, data, len);
 
 #if DEBUG_CP
        BUG_ON(code >= CP_CODES);
index 878b05d06fc7abc64450d8a46ef842d3375a8f0f..40ee80c03c947e8630c935a5e16be00acfd92a95 100644 (file)
@@ -202,7 +202,7 @@ static void x25_asy_bump(struct x25_asy *sl)
                return;
        }
        skb_push(skb, 1);       /* LAPB internal control */
-       memcpy(skb_put(skb, count), sl->rbuff, count);
+       skb_put_data(skb, sl->rbuff, count);
        skb->protocol = x25_type_trans(skb, sl->dev);
        err = lapb_data_received(skb->dev, skb);
        if (err != LAPB_OK) {
index 7f64e74d746b790e70900ef831b63438942632c2..dd7f3168c07dceeab17193fddf561600cf45b158 100644 (file)
@@ -488,7 +488,7 @@ void i2400m_net_rx(struct i2400m *i2400m, struct sk_buff *skb_rx,
                        net_dev->stats.rx_dropped++;
                        goto error_skb_realloc;
                }
-               memcpy(skb_put(skb, buf_len), buf, buf_len);
+               skb_put_data(skb, buf, buf_len);
        }
        i2400m_rx_fake_eth_header(i2400m->wimax_dev.net_dev,
                                  skb->data - ETH_HLEN,
index ed626f568b5802006473e077affd4f417f850917..5f64f3928c35d305bdff49c97f61f15ded69286b 100644 (file)
@@ -390,9 +390,9 @@ static void adm8211_interrupt_rci(struct ieee80211_hw *dev)
                                        priv->pdev,
                                        priv->rx_buffers[entry].mapping,
                                        pktlen, PCI_DMA_FROMDEVICE);
-                               memcpy(skb_put(skb, pktlen),
-                                      skb_tail_pointer(priv->rx_buffers[entry].skb),
-                                      pktlen);
+                               skb_put_data(skb,
+                                            skb_tail_pointer(priv->rx_buffers[entry].skb),
+                                            pktlen);
                                pci_dma_sync_single_for_device(
                                        priv->pdev,
                                        priv->rx_buffers[entry].mapping,
index 4674ff33d3203ac1eb00c8b268bc3b2ffc7d32bc..16cf250f6c395ce168fa0dad2d4dcc761f5e2e09 100644 (file)
@@ -3475,9 +3475,8 @@ static void ath10k_tx_h_add_p2p_noa_ie(struct ath10k *ar,
                if (arvif->u.ap.noa_data)
                        if (!pskb_expand_head(skb, 0, arvif->u.ap.noa_len,
                                              GFP_ATOMIC))
-                               memcpy(skb_put(skb, arvif->u.ap.noa_len),
-                                      arvif->u.ap.noa_data,
-                                      arvif->u.ap.noa_len);
+                               skb_put_data(skb, arvif->u.ap.noa_data,
+                                            arvif->u.ap.noa_len);
                spin_unlock_bh(&ar->data_lock);
        }
 }
index 6afc8d27f0d511e04ad399112fa4a837e7ca715b..a66e2482897f44d99aa6e116aee5b7b1f92c2ae3 100644 (file)
@@ -3304,9 +3304,8 @@ static void ath10k_wmi_update_noa(struct ath10k *ar, struct ath10k_vif *arvif,
 
        if (arvif->u.ap.noa_data)
                if (!pskb_expand_head(bcn, 0, arvif->u.ap.noa_len, GFP_ATOMIC))
-                       memcpy(skb_put(bcn, arvif->u.ap.noa_len),
-                              arvif->u.ap.noa_data,
-                              arvif->u.ap.noa_len);
+                       skb_put_data(bcn, arvif->u.ap.noa_data,
+                                    arvif->u.ap.noa_len);
 }
 
 static int ath10k_wmi_op_pull_swba_ev(struct ath10k *ar, struct sk_buff *skb,
index 373b1e9457fdb120089318da8c504ebe22f2d672..f0439f2d566b1398c74102a92d5161b3e310c79b 100644 (file)
@@ -1005,7 +1005,7 @@ static void ath_scan_send_probe(struct ath_softc *sc,
                info->flags |= IEEE80211_TX_CTL_NO_CCK_RATE;
 
        if (req->ie_len)
-               memcpy(skb_put(skb, req->ie_len), req->ie, req->ie_len);
+               skb_put_data(skb, req->ie, req->ie_len);
 
        skb_set_queue_mapping(skb, IEEE80211_AC_VO);
 
@@ -1521,8 +1521,7 @@ void ath9k_beacon_add_noa(struct ath_softc *sc, struct ath_vif *avp,
        noa_desc = !!avp->offchannel_duration + !!avp->noa_duration;
        noa_len = 2 + sizeof(struct ieee80211_p2p_noa_desc) * noa_desc;
 
-       hdr = skb_put(skb, sizeof(noa_ie_hdr));
-       memcpy(hdr, noa_ie_hdr, sizeof(noa_ie_hdr));
+       hdr = skb_put_data(skb, noa_ie_hdr, sizeof(noa_ie_hdr));
        hdr[1] = sizeof(noa_ie_hdr) + noa_len - 2;
        hdr[7] = noa_len;
 
index 9c16e2a6d185e31c1391e6d4aa4f14c2c9013cd4..c51c69b1ad96a5f9f726e79fd8bbb3003c2348e5 100644 (file)
@@ -312,8 +312,7 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
        skb_reserve(skb, headroom);
 
        if (cmd_len != 0 && cmd_buf != NULL) {
-               data = (u8 *) skb_put(skb, cmd_len);
-               memcpy(data, cmd_buf, cmd_len);
+               data = skb_put_data(skb, cmd_buf, cmd_len);
        }
 
        mutex_lock(&wmi->op_mutex);
index b2166726b05d2651840ade7a1e285e3b8faf7674..705063259c8f0d7d2fe7a9636469a63c9531b282 100644 (file)
@@ -481,7 +481,7 @@ static struct sk_buff *carl9170_rx_copy_data(u8 *buf, int len)
        skb = dev_alloc_skb(len + reserved);
        if (likely(skb)) {
                skb_reserve(skb, reserved);
-               memcpy(skb_put(skb, len), buf, len);
+               skb_put_data(skb, buf, len);
        }
 
        return skb;
@@ -916,7 +916,7 @@ static void carl9170_rx_stream(struct ar9170 *ar, void *buf, unsigned int len)
                                }
                        }
 
-                       memcpy(skb_put(ar->rx_failover, tlen), tbuf, tlen);
+                       skb_put_data(ar->rx_failover, tbuf, tlen);
                        ar->rx_failover_missing -= tlen;
 
                        if (ar->rx_failover_missing <= 0) {
@@ -958,7 +958,7 @@ static void carl9170_rx_stream(struct ar9170 *ar, void *buf, unsigned int len)
                         * the rx - descriptor comes round again.
                         */
 
-                       memcpy(skb_put(ar->rx_failover, tlen), tbuf, tlen);
+                       skb_put_data(ar->rx_failover, tbuf, tlen);
                        ar->rx_failover_missing = clen - tlen;
                        return;
                }
index 814c35645b737a3664bd3047de49d4c9fc10fc69..cff9c585972f1aff4b3b31fcd4b4ce7645a2bc38 100644 (file)
@@ -681,7 +681,7 @@ static void wmi_evt_eapol_rx(struct wil6210_priv *wil, int id,
        ether_addr_copy(eth->h_dest, ndev->dev_addr);
        ether_addr_copy(eth->h_source, evt->src_mac);
        eth->h_proto = cpu_to_be16(ETH_P_PAE);
-       memcpy(skb_put(skb, eapol_len), evt->eapol, eapol_len);
+       skb_put_data(skb, evt->eapol, eapol_len);
        skb->protocol = eth_type_trans(skb, ndev);
        if (likely(netif_rx_ni(skb) == NET_RX_SUCCESS)) {
                ndev->stats.rx_packets++;
index 27b110dc8cc622c5f17f184263ff28406c5154b8..b68436b23a6362ba1d6fef6acca39a0be9d746f4 100644 (file)
@@ -1036,9 +1036,8 @@ static void frag_rx_path(struct atmel_private *priv,
                                priv->dev->stats.rx_dropped++;
                        } else {
                                skb_reserve(skb, 2);
-                               memcpy(skb_put(skb, priv->frag_len + 12),
-                                      priv->rx_buf,
-                                      priv->frag_len + 12);
+                               skb_put_data(skb, priv->rx_buf,
+                                            priv->frag_len + 12);
                                skb->protocol = eth_type_trans(skb, priv->dev);
                                skb->ip_summed = CHECKSUM_NONE;
                                netif_rx(skb);
index f9dd892b9f27e9978ea35e8514f457d037b2d9b1..cfa617ddb2f12174ebccd68e19c27cb1fbe7257e 100644 (file)
@@ -1072,7 +1072,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
                        goto out_unmap_hdr;
                }
 
-               memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len);
+               skb_put_data(bounce_skb, skb->data, skb->len);
                memcpy(bounce_skb->cb, skb->cb, sizeof(skb->cb));
                bounce_skb->dev = skb->dev;
                skb_set_queue_mapping(bounce_skb, skb_get_queue_mapping(skb));
index bbc579b647b61b6aa15b8ed3b7f4455cb8dd404c..e0c690b48d4e42c98853d406fa21f0fbbd6ff59c 100644 (file)
@@ -10274,8 +10274,9 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct libipw_txb *txb,
 
                                printk(KERN_INFO "Adding frag %d %d...\n",
                                       j, size);
-                               memcpy(skb_put(skb, size),
-                                      txb->fragments[j]->data + hdr_len, size);
+                               skb_put_data(skb,
+                                            txb->fragments[j]->data + hdr_len,
+                                            size);
                        }
                        dev_kfree_skb_any(txb->fragments[i]);
                        txb->fragments[i] = skb;
index 048f1e3ada1191b1a2217972cff4c30f47fddd58..5339d1eeb2f7a7078305fc89548098d5278ac139 100644 (file)
@@ -359,7 +359,7 @@ netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev)
                        goto failed;
 
                skb_reserve(skb_new, crypt->ops->extra_msdu_prefix_len);
-               memcpy(skb_put(skb_new, hdr_len), &header, hdr_len);
+               skb_put_data(skb_new, &header, hdr_len);
                snapped = 1;
                libipw_copy_snap(skb_put(skb_new, SNAP_SIZE + sizeof(u16)),
                                    ether_type);
@@ -470,9 +470,7 @@ netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev)
                        skb_reserve(skb_frag,
                                    crypt->ops->extra_mpdu_prefix_len);
 
-               frag_hdr =
-                   (struct libipw_hdr_3addrqos *)skb_put(skb_frag, hdr_len);
-               memcpy(frag_hdr, &header, hdr_len);
+               frag_hdr = skb_put_data(skb_frag, &header, hdr_len);
 
                /* If this is not the last fragment, then add the MOREFRAGS
                 * bit to the frame control */
index 080ea8155b908499d8efc8cf0a33ad0e2da0493b..dbf164d48ed3c12b611dbfb66a21476c163e522c 100644 (file)
@@ -520,7 +520,7 @@ il3945_pass_packet_to_mac80211(struct il_priv *il, struct il_rx_buf *rxb,
         * and do not consume a full page
         */
        if (len <= SMALL_PACKET_SIZE) {
-               memcpy(skb_put(skb, len), rx_hdr->payload, len);
+               skb_put_data(skb, rx_hdr->payload, len);
        } else {
                skb_add_rx_frag(skb, 0, rxb->page,
                                (void *)rx_hdr->payload - (void *)pkt, len,
index 49a2ff15ddaead3a6f21b0d9ae801eb8383847d3..5b51fba755954f2dbe910cf5b0d992ab2d37e0e8 100644 (file)
@@ -606,7 +606,7 @@ il4965_pass_packet_to_mac80211(struct il_priv *il, struct ieee80211_hdr *hdr,
        }
 
        if (len <= SMALL_PACKET_SIZE) {
-               memcpy(skb_put(skb, len), hdr, len);
+               skb_put_data(skb, hdr, len);
        } else {
                skb_add_rx_frag(skb, 0, rxb->page, (void *)hdr - rxb_addr(rxb),
                                len, PAGE_SIZE << il->hw_params.rx_page_order);
index adfd6307edca9d21eb20f36994d10b2fb9c391a7..eaad7389b67c17cc6478468437112b877bc15245 100644 (file)
@@ -657,7 +657,7 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
         */
        hdrlen = (len <= skb_tailroom(skb)) ? len : sizeof(*hdr);
 
-       memcpy(skb_put(skb, hdrlen), hdr, hdrlen);
+       skb_put_data(skb, hdr, hdrlen);
        fraglen = len - hdrlen;
 
        if (fraglen) {
index 4b97371c3b4291a8abf8ea5c9793f52351486d48..adaa2f0097cc085b964ad4fd571b1ca17e85b8b0 100644 (file)
@@ -319,8 +319,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv,
                if (noa_data &&
                    pskb_expand_head(skb, 0, noa_data->length,
                                     GFP_ATOMIC) == 0) {
-                       memcpy(skb_put(skb, noa_data->length),
-                              noa_data->data, noa_data->length);
+                       skb_put_data(skb, noa_data->data, noa_data->length);
                        hdr = (struct ieee80211_hdr *)skb->data;
                }
        }
index 119a3bd92c50f72c7c47756928734b99b7397f90..7a56a0ac151cddbeaf6bc894a682049bcc056c50 100644 (file)
@@ -1431,7 +1431,7 @@ static void iwl_mvm_report_wakeup_reasons(struct iwl_mvm *mvm,
                        if (!pkt)
                                goto report;
 
-                       memcpy(skb_put(pkt, hdrlen), pktdata, hdrlen);
+                       skb_put_data(pkt, pktdata, hdrlen);
                        pktdata += hdrlen;
                        pktsize -= hdrlen;
 
@@ -1463,7 +1463,7 @@ static void iwl_mvm_report_wakeup_reasons(struct iwl_mvm *mvm,
                        pktsize -= ivlen + icvlen;
                        pktdata += ivlen;
 
-                       memcpy(skb_put(pkt, pktsize), pktdata, pktsize);
+                       skb_put_data(pkt, pktdata, pktsize);
 
                        if (ieee80211_data_to_8023(pkt, vif->addr, vif->type))
                                goto report;
index fd2fc46e2fe51d8e8f1930af05e40ee9400c84a6..15d13017c1dfbf98eb5ff9bfd543863a25a1c03d 100644 (file)
@@ -1596,7 +1596,7 @@ void iwl_mvm_rx_stored_beacon_notif(struct iwl_mvm *mvm,
                                               rx_status.band);
 
        /* copy the data */
-       memcpy(skb_put(skb, size), sb->data, size);
+       skb_put_data(skb, sb->data, size);
        memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
 
        /* pass it as regular rx to mac80211 */
index fd1dd06c4f182902c32ed3ba1cf30e1fac1d8b3b..2c07719aa45c6181de30c9dfbf7be57d11b8a610 100644 (file)
@@ -133,7 +133,7 @@ static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
         */
        hdrlen = (len <= skb_tailroom(skb)) ? len : hdrlen + crypt_len + 8;
 
-       memcpy(skb_put(skb, hdrlen), hdr, hdrlen);
+       skb_put_data(skb, hdr, hdrlen);
        fraglen = len - hdrlen;
 
        if (fraglen) {
index 966cd7543629b3c2dd6d9bbf33fcaffd9582ab63..cf48390f6f68ee973b30ec1abd267bcfd3646d92 100644 (file)
@@ -183,9 +183,8 @@ static void iwl_mvm_create_skb(struct sk_buff *skb, struct ieee80211_hdr *hdr,
         * present before copying packet data.
         */
        hdrlen += crypt_len;
-       memcpy(skb_put(skb, hdrlen), hdr, hdrlen);
-       memcpy(skb_put(skb, headlen - hdrlen), (u8 *)hdr + hdrlen + pad_len,
-              headlen - hdrlen);
+       skb_put_data(skb, hdr, hdrlen);
+       skb_put_data(skb, (u8 *)hdr + hdrlen + pad_len, headlen - hdrlen);
 
        fraglen = len - headlen;
 
index 386950a2d6162845ccf3aa2ca24c968750d5d2cd..01013d273aa71d5742ba07aeaddc6c6a2283309f 100644 (file)
@@ -2141,8 +2141,7 @@ static int iwl_fill_data_tbs_amsdu(struct iwl_trans *trans, struct sk_buff *skb,
                                                        htons(ETH_P_IPV6),
                                                    data_left);
 
-                       memcpy(skb_put(csum_skb, tcp_hdrlen(skb)),
-                              tcph, tcp_hdrlen(skb));
+                       skb_put_data(csum_skb, tcph, tcp_hdrlen(skb));
                        skb_reset_transport_header(csum_skb);
                        csum_skb->csum_start =
                                (unsigned char *)tcp_hdr(csum_skb) -
@@ -2176,7 +2175,7 @@ static int iwl_fill_data_tbs_amsdu(struct iwl_trans *trans, struct sk_buff *skb,
                        dma_addr_t tb_phys;
 
                        if (trans_pcie->sw_csum_tx)
-                               memcpy(skb_put(csum_skb, size), tso.data, size);
+                               skb_put_data(csum_skb, tso.data, size);
 
                        tb_phys = dma_map_single(trans->dev, tso.data,
                                                 size, DMA_TO_DEVICE);
index 055e11d353caf4c679688f45c35e8f02de4bce42..c1b10d5117ad33bf33e931398b8a8eacfc992781 100644 (file)
@@ -242,7 +242,7 @@ netdev_tx_t hostap_data_start_xmit(struct sk_buff *skb,
                memcpy(skb_push(skb, encaps_len), encaps_data, encaps_len);
        memcpy(skb_push(skb, hdr_len), &hdr, hdr_len);
        if (use_wds == WDS_OWN_FRAME) {
-               memcpy(skb_put(skb, ETH_ALEN), &hdr.addr4, ETH_ALEN);
+               skb_put_data(skb, &hdr.addr4, ETH_ALEN);
        }
 
        iface->stats.tx_packets++;
index 89b5987303a497506c2320faf6da986f085ac4d7..91757defb9bebeac5f41b383947c36f24034dbd3 100644 (file)
@@ -1000,7 +1000,7 @@ static void prism2_send_mgmt(struct net_device *dev,
        hdrlen = hostap_80211_get_hdrlen(cpu_to_le16(type_subtype));
        hdr = skb_put_zero(skb, hdrlen);
        if (body)
-               memcpy(skb_put(skb, body_len), body, body_len);
+               skb_put_data(skb, body, body_len);
 
        /* FIX: ctrl::ack sending used special HFA384X_TX_CTRL_802_11
         * tx_control instead of using local->tx_control */
index d4f0b730796e2839f13e4e9fdb1a74b458c43e43..72b46eaf3de21ce1e6b6b43064f4488a61e2c4f5 100644 (file)
@@ -2005,7 +2005,7 @@ static void prism2_rx(local_info_t *local)
                goto rx_dropped;
        }
        skb->dev = dev;
-       memcpy(skb_put(skb, hdr_len), &rxdesc, hdr_len);
+       skb_put_data(skb, &rxdesc, hdr_len);
 
        if (len > 0)
                res = hfa384x_from_bap(dev, BAP0, skb_put(skb, len), len);
@@ -2209,9 +2209,9 @@ static void hostap_tx_callback(local_info_t *local,
                return;
        }
 
-       memcpy(skb_put(skb, hdrlen), (void *) &txdesc->frame_control, hdrlen);
+       skb_put_data(skb, (void *)&txdesc->frame_control, hdrlen);
        if (payload)
-               memcpy(skb_put(skb, len), payload, len);
+               skb_put_data(skb, payload, len);
 
        skb->dev = local->dev;
        skb_reset_mac_header(skb);
@@ -2362,8 +2362,7 @@ static void prism2_txexc(local_info_t *local)
                struct sk_buff *skb;
                skb = dev_alloc_skb(sizeof(txdesc));
                if (skb) {
-                       memcpy(skb_put(skb, sizeof(txdesc)), &txdesc,
-                              sizeof(txdesc));
+                       skb_put_data(skb, &txdesc, sizeof(txdesc));
                        skb_queue_tail(&local->sta_tx_exc_list, skb);
                        tasklet_schedule(&local->sta_tx_exc_tasklet);
                }
@@ -2460,7 +2459,7 @@ static void prism2_info(local_info_t *local)
                goto out;
        }
 
-       memcpy(skb_put(skb, sizeof(info)), &info, sizeof(info));
+       skb_put_data(skb, &info, sizeof(info));
        if (left > 0 && hfa384x_from_bap(dev, BAP0, skb_put(skb, left), left))
        {
                spin_unlock(&local->baplock);
index 400f9b5d620efd479c777a9ceaa9f847d8801da1..a3c066f90afc2f103b0ff11c711bc7fab2c25c98 100644 (file)
@@ -1045,7 +1045,7 @@ int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u16 stype,
        memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN);
        memcpy(mgmt->bssid, dst, ETH_ALEN);
        if (body)
-               memcpy(skb_put(skb, bodylen), body, bodylen);
+               skb_put_data(skb, body, bodylen);
 
        meta = (struct hostap_skb_tx_data *) skb->cb;
        memset(meta, 0, sizeof(*meta));
index d9128bb25e85657f1f419ed603ad3f13f34939f2..f7abc439fb927a8e52ccc517ccd05174be2d7862 100644 (file)
@@ -792,7 +792,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
        }
 
        /* Copy the 802.11 header to the skb */
-       memcpy(skb_put(skb, hdrlen), &(desc->frame_ctl), hdrlen);
+       skb_put_data(skb, &(desc->frame_ctl), hdrlen);
        skb_reset_mac_header(skb);
 
        /* If any, copy the data from the card to the skb */
index 7ab2f43ab42512e7da0c87c37574b8ed534f2b08..e41bf042352edbee19cb08efa0e34d7a8218fb9f 100644 (file)
@@ -372,9 +372,9 @@ static int p54spi_rx(struct p54s_priv *priv)
        }
 
        if (len <= READAHEAD_SZ) {
-               memcpy(skb_put(skb, len), rx_head + 1, len);
+               skb_put_data(skb, rx_head + 1, len);
        } else {
-               memcpy(skb_put(skb, READAHEAD_SZ), rx_head + 1, READAHEAD_SZ);
+               skb_put_data(skb, rx_head + 1, READAHEAD_SZ);
                p54spi_spi_read(priv, SPI_ADRS_DMA_DATA,
                                skb_put(skb, len - READAHEAD_SZ),
                                len - READAHEAD_SZ);
index 60f9b678ef74511e9ebbb0676759f3a7201c15d2..b00c07d72f9511eb843a0acba61c18f61b8609ed 100644 (file)
@@ -905,8 +905,9 @@ void p54_tx_80211(struct ieee80211_hw *dev,
                if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) {
                        /* reserve space for the MIC key */
                        len += 8;
-                       memcpy(skb_put(skb, 8), &(info->control.hw_key->key
-                               [NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY]), 8);
+                       skb_put_data(skb,
+                                    &(info->control.hw_key->key[NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY]),
+                                    8);
                }
                /* reserve some space for ICV */
                len += info->control.hw_key->icv_len;
index c854a557998b4266c5d63c55c0463497e8dde715..1d6e180052b8cd6252e4c979299ee46b9c2209a4 100644 (file)
@@ -2020,8 +2020,7 @@ static void hw_scan_work(struct work_struct *work)
                        memcpy(mgmt->bssid, req->bssid, ETH_ALEN);
 
                        if (req->ie_len)
-                               memcpy(skb_put(probe, req->ie_len), req->ie,
-                                      req->ie_len);
+                               skb_put_data(probe, req->ie, req->ie_len);
 
                        local_bh_disable();
                        mac80211_hwsim_tx_frame(hwsim->hw, probe,
@@ -3021,7 +3020,7 @@ static int hwsim_cloned_frame_received_nl(struct sk_buff *skb_2,
                goto err;
 
        /* Copy the data */
-       memcpy(skb_put(skb, frame_data_len), frame_data, frame_data_len);
+       skb_put_data(skb, frame_data, frame_data_len);
 
        data2 = get_hwsim_data_ref_from_addr(dst);
        if (!data2)
index e0196208ab0d57bb0b2cfecf38382bfba0ec2838..a9e2b06b3175c299a0757775a121cb13caabfdb5 100644 (file)
@@ -256,9 +256,7 @@ static int if_sdio_handle_data(struct if_sdio_card *card,
 
        skb_reserve(skb, NET_IP_ALIGN);
 
-       data = skb_put(skb, size);
-
-       memcpy(data, buffer, size);
+       data = skb_put_data(skb, buffer, size);
 
        lbs_process_rxed_packet(card->priv, skb);
 
index 53e67526f40d5dd524736b06f5ffdf6e0b767525..bc12c37e7501360f2677eb623fa7ece02620de92 100644 (file)
@@ -81,7 +81,7 @@ mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr,
        tx_header->eth803_hdr.h_proto = htons(skb_src->len + LLC_SNAP_LEN);
 
        /* Add payload */
-       memcpy(skb_put(skb_aggr, skb_src->len), skb_src->data, skb_src->len);
+       skb_put_data(skb_aggr, skb_src->data, skb_src->len);
 
        /* Add padding for new MSDU to start from 4 byte boundary */
        *pad = (4 - ((unsigned long)skb_aggr->tail & 0x3)) % 4;
index 025bc06a19d66ef03101e8e8d2079d1ede2da8b9..c20e4944ef87cb01a5e9bc153856276ddf999b62 100644 (file)
@@ -176,12 +176,10 @@ mwifiex_form_mgmt_frame(struct sk_buff *skb, const u8 *buf, size_t len)
        memcpy(skb_push(skb, sizeof(pkt_type)), &pkt_type, sizeof(pkt_type));
 
        /* Add packet data and address4 */
-       memcpy(skb_put(skb, sizeof(struct ieee80211_hdr_3addr)), buf,
-              sizeof(struct ieee80211_hdr_3addr));
-       memcpy(skb_put(skb, ETH_ALEN), addr, ETH_ALEN);
-       memcpy(skb_put(skb, len - sizeof(struct ieee80211_hdr_3addr)),
-              buf + sizeof(struct ieee80211_hdr_3addr),
-              len - sizeof(struct ieee80211_hdr_3addr));
+       skb_put_data(skb, buf, sizeof(struct ieee80211_hdr_3addr));
+       skb_put_data(skb, addr, ETH_ALEN);
+       skb_put_data(skb, buf + sizeof(struct ieee80211_hdr_3addr),
+                    len - sizeof(struct ieee80211_hdr_3addr));
 
        skb->priority = LOW_PRIO_TID;
        __net_timestamp(skb);
index c76b7315af552d5f2c983756b59b3093a869e3b4..d38555fe42847399cb17f78ad2ef7937239adacc 100644 (file)
@@ -679,8 +679,7 @@ int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer,
                        return ret;
                }
                if (extra_ies_len)
-                       memcpy(skb_put(skb, extra_ies_len), extra_ies,
-                              extra_ies_len);
+                       skb_put_data(skb, extra_ies, extra_ies_len);
                mwifiex_tdls_add_link_ie(skb, priv->curr_addr, peer,
                                         priv->cfg_bssid);
                break;
@@ -693,8 +692,7 @@ int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer,
                        return ret;
                }
                if (extra_ies_len)
-                       memcpy(skb_put(skb, extra_ies_len), extra_ies,
-                              extra_ies_len);
+                       skb_put_data(skb, extra_ies, extra_ies_len);
                mwifiex_tdls_add_link_ie(skb, peer, priv->curr_addr,
                                         priv->cfg_bssid);
                break;
@@ -865,7 +863,7 @@ int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer,
        }
 
        if (extra_ies_len)
-               memcpy(skb_put(skb, extra_ies_len), extra_ies, extra_ies_len);
+               skb_put_data(skb, extra_ies, extra_ies_len);
 
        /* the TDLS link IE is always added last we are the responder */
 
index a8bc064bc14f4e52c32b5be23dbbb61f0f618106..660267b359e48d7b0cd85011d3f2e406c9bd64df 100644 (file)
@@ -52,7 +52,7 @@ mt7601u_rx_skb_from_seg(struct mt7601u_dev *dev, struct mt7601u_rxwi *rxwi,
                goto bad_frame;
 
        if (rxwi->rxinfo & cpu_to_le32(MT_RXINFO_L2PAD)) {
-               memcpy(skb_put(skb, hdr_len), data, hdr_len);
+               skb_put_data(skb, data, hdr_len);
 
                data += hdr_len + 2;
                true_len -= hdr_len;
@@ -63,7 +63,7 @@ mt7601u_rx_skb_from_seg(struct mt7601u_dev *dev, struct mt7601u_rxwi *rxwi,
        copy = (true_len <= skb_tailroom(skb)) ? true_len : hdr_len + 8;
        frag = true_len - copy;
 
-       memcpy(skb_put(skb, copy), data, copy);
+       skb_put_data(skb, data, copy);
        data += copy;
 
        if (frag) {
index a9f5f398b2f860c239db8f6e17899d9adcdc7f33..65a8004418ea45b3f21cf2d746443c891470f881 100644 (file)
@@ -68,7 +68,7 @@ mt7601u_mcu_msg_alloc(struct mt7601u_dev *dev, const void *data, int len)
        skb = alloc_skb(len + MT_DMA_HDR_LEN + 4, GFP_KERNEL);
        if (skb) {
                skb_reserve(skb, MT_DMA_HDR_LEN);
-               memcpy(skb_put(skb, len), data, len);
+               skb_put_data(skb, data, len);
        }
 
        return skb;
index 4814d90c8040f89e6cd86e1abcd0c4da183a8541..f93b27f3a2360e6c2e527a22537c39ba6c8c4e3e 100644 (file)
@@ -213,7 +213,7 @@ static void qtnf_pcie_control_rx_callback(void *arg, const u8 *buf, size_t len)
                return;
        }
 
-       memcpy(skb_put(skb, len), buf, len);
+       skb_put_data(skb, buf, len);
 
        qtnf_trans_handle_rx_ctl_packet(bus, skb);
 }
index d8de484b59951dfd1a8e5a459cd5662523f5f67d..9844ff0add2b40d5e8fd74e4e83cda4d7acf2a8b 100644 (file)
@@ -35,8 +35,7 @@ qtnf_cmd_skb_put_buffer(struct sk_buff *skb, const u8 *buf_src, size_t len)
 {
        u8 *buf_dst;
 
-       buf_dst = skb_put(skb, len);
-       memcpy(buf_dst, buf_src, len);
+       buf_dst = skb_put_data(skb, buf_src, len);
 }
 
 static inline void qtnf_cmd_skb_put_tlv_arr(struct sk_buff *skb,
index 4a1bca1b1e2678e97387d19d338a46cb3b62aa34..b70985e126bf33b83ab2888125a49e810248cecf 100644 (file)
@@ -203,9 +203,8 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
        dump_hdr->timestamp_usec = cpu_to_le32(timestamp.tv_usec);
 
        if (!(skbdesc->flags & SKBDESC_DESC_IN_SKB))
-               memcpy(skb_put(skbcopy, skbdesc->desc_len), skbdesc->desc,
-                      skbdesc->desc_len);
-       memcpy(skb_put(skbcopy, skb->len), skb->data, skb->len);
+               skb_put_data(skbcopy, skbdesc->desc, skbdesc->desc_len);
+       skb_put_data(skbcopy, skb->data, skb->len);
 
        skb_queue_tail(&intf->frame_dump_skbqueue, skbcopy);
        wake_up_interruptible(&intf->frame_dump_waitqueue);
index 2e6b888bd417f0aeef5202a231fbbfb9e5ab2652..0c1f8307e1796bc32d7c0b008298b2453c395881 100644 (file)
@@ -735,8 +735,7 @@ static void _rtl_pci_rx_to_mac80211(struct ieee80211_hw *hw,
                if (likely(uskb)) {
                        memcpy(IEEE80211_SKB_RXCB(uskb), &rx_status,
                               sizeof(rx_status));
-                       pdata = (u8 *)skb_put(uskb, skb->len);
-                       memcpy(pdata, skb->data, skb->len);
+                       pdata = skb_put_data(uskb, skb->data, skb->len);
                        dev_kfree_skb_any(skb);
                        ieee80211_rx_irqsafe(hw, uskb);
                } else {
index 21ed9ad3be7ad0c209a296e2114981742aa23799..a2eca669873b641dc3efec908f03c535e2b741a1 100644 (file)
@@ -620,8 +620,7 @@ void rtl88e_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
                      u1rsvdpageloc, 3);
 
        skb = dev_alloc_skb(totalpacketlen);
-       memcpy(skb_put(skb, totalpacketlen),
-              &reserved_page_packet, totalpacketlen);
+       skb_put_data(skb, &reserved_page_packet, totalpacketlen);
 
        rtstatus = rtl_cmd_send_packet(hw, skb);
 
index 89a0a28b8b202bc0c978ecb536a8bbc20258e8bb..dd3ba4810e7d8b6ec0e2554d8001c872aa790c64 100644 (file)
@@ -188,10 +188,9 @@ static bool _rtl92s_firmware_downloadcode(struct ieee80211_hw *hw,
                if (!skb)
                        return false;
                skb_reserve(skb, extra_descoffset);
-               seg_ptr = (u8 *)skb_put(skb, (u32)(frag_length -
-                                       extra_descoffset));
-               memcpy(seg_ptr, code_virtual_address + frag_offset,
-                      (u32)(frag_length - extra_descoffset));
+               seg_ptr = skb_put_data(skb,
+                                      code_virtual_address + frag_offset,
+                                      (u32)(frag_length - extra_descoffset));
 
                tcb_desc = (struct rtl_tcb_desc *)(skb->cb);
                tcb_desc->queue_index = TXCMD_QUEUE;
index 4d989b8ab185681aa500b4e7de7fc34260f904a9..5590d07d0918bf7015874bd27b061c097509c068 100644 (file)
@@ -653,7 +653,7 @@ static void _rtl_rx_completed(struct urb *_urb)
                /* reserve some space for mac80211's radiotap */
                skb_reserve(skb, __RADIO_TAP_SIZE_RSV);
 
-               memcpy(skb_put(skb, size), _urb->transfer_buffer, size);
+               skb_put_data(skb, _urb->transfer_buffer, size);
 
                skb_queue_tail(&rtlusb->rx_queue, skb);
                tasklet_schedule(&rtlusb->rx_work_tasklet);
index fac87c06357b234fc30827dcc5e0ca157c0532c2..4433cec4367ccc20c80bda236e8171da449d6926 100644 (file)
@@ -412,11 +412,9 @@ static int rsi_mgmt_pkt_to_core(struct rsi_common *common,
                        return -ENOMEM;
                }
 
-               buffer = skb_put(skb, msg_len);
-
-               memcpy(buffer,
-                      (u8 *)(msg +  FRAME_DESC_SZ + pad_bytes),
-                      msg_len);
+               buffer = skb_put_data(skb,
+                                     (u8 *)(msg + FRAME_DESC_SZ + pad_bytes),
+                                     msg_len);
 
                pkt_recv = buffer[0];
 
index 0a0ff7e31f5b2f00a83f24fb0fad9888f299647f..cc2ce60f4f097d93b09317801cda2376d8b880f0 100644 (file)
@@ -84,7 +84,7 @@ int cw1200_hw_scan(struct ieee80211_hw *hw,
                return -ENOMEM;
 
        if (req->ie_len)
-               memcpy(skb_put(frame.skb, req->ie_len), req->ie, req->ie_len);
+               skb_put_data(frame.skb, req->ie, req->ie_len);
 
        /* will be unlocked in cw1200_scan_work() */
        down(&priv->scan.lock);
index bbf7604889b7574b926ee3ac7467b5902e15ca45..08f0477f78d93d102b11524cffeb982d7ac29c82 100644 (file)
@@ -1036,7 +1036,7 @@ static int wl1251_op_hw_scan(struct ieee80211_hw *hw,
                goto out_idle;
        }
        if (req->ie_len)
-               memcpy(skb_put(skb, req->ie_len), req->ie, req->ie_len);
+               skb_put_data(skb, req->ie, req->ie_len);
 
        ret = wl1251_cmd_template_set(wl, CMD_PROBE_REQ, skb->data,
                                      skb->len);
index 4a39fb13c4782751a8e190c95905083a179d230a..229f4d01f239ee7d4155899c30dfc482028d31e1 100644 (file)
@@ -1156,9 +1156,9 @@ int wl12xx_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif,
                goto out;
        }
        if (ie0_len)
-               memcpy(skb_put(skb, ie0_len), ie0, ie0_len);
+               skb_put_data(skb, ie0, ie0_len);
        if (ie1_len)
-               memcpy(skb_put(skb, ie1_len), ie1, ie1_len);
+               skb_put_data(skb, ie1, ie1_len);
 
        if (sched_scan &&
            (wl->quirks & WLCORE_QUIRK_DUAL_PROBE_TMPL)) {
index 52a55f9acd80d41da600b16c2b379ff9a680c83a..53cd6d4d5b505d644553c27e45c5fd9bb1217f44 100644 (file)
@@ -174,15 +174,13 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length,
        /* reserve the unaligned payload(if any) */
        skb_reserve(skb, reserved);
 
-       buf = skb_put(skb, pkt_data_len);
-
        /*
         * Copy packets from aggregation buffer to the skbs without rx
         * descriptor and with packet payload aligned care. In case of unaligned
         * packets copy the packets in offset of 2 bytes guarantee IP header
         * payload aligned to 4 bytes.
         */
-       memcpy(buf, data + sizeof(*desc), pkt_data_len);
+       buf = skb_put_data(skb, data + sizeof(*desc), pkt_data_len);
        if (rx_align == WLCORE_RX_BUF_PADDED)
                skb_pull(skb, RX_BUF_ALIGN);
 
index de7ff395977a31820913eb1d43aa2509d979c136..7f586d76cf1752ed46a03769d28037f9dcfcac34 100644 (file)
@@ -326,13 +326,13 @@ static void zd1201_usbrx(struct urb *urb)
                        if (!(skb = dev_alloc_skb(datalen+24)))
                                goto resubmit;
                        
-                       memcpy(skb_put(skb, 2), &data[datalen-16], 2);
-                       memcpy(skb_put(skb, 2), &data[datalen-2], 2);
-                       memcpy(skb_put(skb, 6), &data[datalen-14], 6);
-                       memcpy(skb_put(skb, 6), &data[datalen-22], 6);
-                       memcpy(skb_put(skb, 6), &data[datalen-8], 6);
-                       memcpy(skb_put(skb, 2), &data[datalen-24], 2);
-                       memcpy(skb_put(skb, len), data, len);
+                       skb_put_data(skb, &data[datalen - 16], 2);
+                       skb_put_data(skb, &data[datalen - 2], 2);
+                       skb_put_data(skb, &data[datalen - 14], 6);
+                       skb_put_data(skb, &data[datalen - 22], 6);
+                       skb_put_data(skb, &data[datalen - 8], 6);
+                       skb_put_data(skb, &data[datalen - 24], 2);
+                       skb_put_data(skb, data, len);
                        skb->protocol = eth_type_trans(skb, zd->dev);
                        zd->dev->stats.rx_packets++;
                        zd->dev->stats.rx_bytes += skb->len;
@@ -359,9 +359,9 @@ static void zd1201_usbrx(struct urb *urb)
                                frag->skb = skb;
                                frag->seq = seq & IEEE80211_SCTL_SEQ;
                                skb_reserve(skb, 2);
-                               memcpy(skb_put(skb, 12), &data[datalen-14], 12);
-                               memcpy(skb_put(skb, 2), &data[6], 2);
-                               memcpy(skb_put(skb, len), data+8, len);
+                               skb_put_data(skb, &data[datalen - 14], 12);
+                               skb_put_data(skb, &data[6], 2);
+                               skb_put_data(skb, data + 8, len);
                                hlist_add_head(&frag->fnode, &zd->fraglist);
                                goto resubmit;
                        }
@@ -385,9 +385,9 @@ static void zd1201_usbrx(struct urb *urb)
                        if (!skb)
                                goto resubmit;
                        skb_reserve(skb, 2);
-                       memcpy(skb_put(skb, 12), &data[datalen-14], 12);
-                       memcpy(skb_put(skb, 2), &data[6], 2);
-                       memcpy(skb_put(skb, len), data+8, len);
+                       skb_put_data(skb, &data[datalen - 14], 12);
+                       skb_put_data(skb, &data[6], 2);
+                       skb_put_data(skb, data + 8, len);
                }
                skb->protocol = eth_type_trans(skb, zd->dev);
                zd->dev->stats.rx_packets++;
index fe6517a621b083ea3995703784de74a68a9655d4..2d929d2edb00dc1b06c75f0541d7164b241cfa9e 100644 (file)
@@ -1103,7 +1103,7 @@ int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length)
        }
 
        /* FIXME : could we avoid this big memcpy ? */
-       memcpy(skb_put(skb, length), buffer, length);
+       skb_put_data(skb, buffer, length);
 
        memcpy(IEEE80211_SKB_RXCB(skb), &stats, sizeof(stats));
        ieee80211_rx_irqsafe(hw, skb);
index 7c1eaea3b68546dccbee989786a8f563932485e0..badd8167ac737103edb999d3eea6c334cf63846d 100644 (file)
@@ -228,8 +228,7 @@ static int fdp_nci_send_patch(struct nci_dev *ndev, u8 conn_id, u8 type)
 
                skb_reserve(skb, NCI_CTRL_HDR_SIZE);
 
-               memcpy(skb_put(skb, payload_size), fw->data + (fw->size - len),
-                      payload_size);
+               skb_put_data(skb, fw->data + (fw->size - len), payload_size);
 
                rc = nci_send_data(ndev, conn_id, skb);
 
index 712936f5d2d64a200f16a28e044aeb4a362dc7ff..0877e2283f35b02757af52188182815f93bc6977 100644 (file)
@@ -186,7 +186,7 @@ static int fdp_nci_i2c_read(struct fdp_i2c_phy *phy, struct sk_buff **skb)
                                goto flush;
                        }
 
-                       memcpy(skb_put(*skb, len), tmp, len);
+                       skb_put_data(*skb, tmp, len);
                        fdp_nci_i2c_dump_skb(&client->dev, "fdp_rd", *skb);
 
                        fdp_nci_i2c_remove_len_lrc(*skb);
index c38bdd6a5a821899d16488f3b988b741316cb26e..7c710458568e3b3deb7e6d50a1873e439da37be9 100644 (file)
@@ -324,10 +324,9 @@ static int process_state_fw_dnld(struct nfcmrvl_private *priv,
                        out_skb = alloc_lc_skb(priv, priv->fw_dnld.chunk_len);
                        if (!out_skb)
                                return -ENOMEM;
-                       memcpy(skb_put(out_skb, priv->fw_dnld.chunk_len),
-                              ((uint8_t *)priv->fw_dnld.fw->data) +
-                              priv->fw_dnld.offset,
-                              priv->fw_dnld.chunk_len);
+                       skb_put_data(out_skb,
+                                    ((uint8_t *)priv->fw_dnld.fw->data) + priv->fw_dnld.offset,
+                                    priv->fw_dnld.chunk_len);
                        nci_send_frame(priv->ndev, out_skb);
                        priv->fw_dnld.substate = SUBSTATE_WAIT_DATA_CREDIT;
                }
index 78b7aa835c81df971e2a90ac8594b6b1dd40cd0d..ffec103702f14c1db74092f511661869d463fba6 100644 (file)
@@ -60,7 +60,7 @@ static int nfcmrvl_i2c_read(struct nfcmrvl_i2c_drv_data *drv_data,
                return -ENOMEM;
 
        /* Copy NCI header into the SKB */
-       memcpy(skb_put(*skb, NCI_CTRL_HDR_SIZE), &nci_hdr, NCI_CTRL_HDR_SIZE);
+       skb_put_data(*skb, &nci_hdr, NCI_CTRL_HDR_SIZE);
 
        if (nci_hdr.plen) {
                /* Read the NCI payload */
index 585a0f20835b19e19f583b0829d20738d6be0754..699aa9d1657532c7d15e46c2c2e178f02c175517 100644 (file)
@@ -83,8 +83,8 @@ static void nfcmrvl_bulk_complete(struct urb *urb)
                if (!skb) {
                        nfc_err(&drv_data->udev->dev, "failed to alloc mem\n");
                } else {
-                       memcpy(skb_put(skb, urb->actual_length),
-                              urb->transfer_buffer, urb->actual_length);
+                       skb_put_data(skb, urb->transfer_buffer,
+                                    urb->actual_length);
                        if (nfcmrvl_nci_recv_frame(drv_data->priv, skb) < 0)
                                nfc_err(&drv_data->udev->dev,
                                        "corrupted Rx packet\n");
index 553011f583395f609b48f591289d0025a2975551..99ffee1dfd1e11bfde5be9fb82b890df29277bda 100644 (file)
@@ -124,8 +124,7 @@ static int nxp_nci_fw_send_chunk(struct nxp_nci_info *info)
        header |= chunk_len & NXP_NCI_FW_FRAME_LEN_MASK;
        put_unaligned_be16(header, skb_put(skb, NXP_NCI_FW_HDR_LEN));
 
-       memcpy(skb_put(skb, chunk_len), fw_info->data + fw_info->written,
-              chunk_len);
+       skb_put_data(skb, fw_info->data + fw_info->written, chunk_len);
 
        crc = nxp_nci_fw_crc(skb->data, chunk_len + NXP_NCI_FW_HDR_LEN);
        put_unaligned_be16(crc, skb_put(skb, NXP_NCI_FW_CRC_LEN));
index ff22d761183cbed59aef9cf38eee29c4bd1de407..198585bbc7711275d53a656aaf2eca12563db8e2 100644 (file)
@@ -135,7 +135,7 @@ static int nxp_nci_i2c_fw_read(struct nxp_nci_i2c_phy *phy,
                goto fw_read_exit;
        }
 
-       memcpy(skb_put(*skb, NXP_NCI_FW_HDR_LEN), &header, NXP_NCI_FW_HDR_LEN);
+       skb_put_data(*skb, &header, NXP_NCI_FW_HDR_LEN);
 
        r = i2c_master_recv(client, skb_put(*skb, frame_len), frame_len);
        if (r != frame_len) {
@@ -176,8 +176,7 @@ static int nxp_nci_i2c_nci_read(struct nxp_nci_i2c_phy *phy,
                goto nci_read_exit;
        }
 
-       memcpy(skb_put(*skb, NCI_CTRL_HDR_SIZE), (void *) &header,
-              NCI_CTRL_HDR_SIZE);
+       skb_put_data(*skb, (void *)&header, NCI_CTRL_HDR_SIZE);
 
        r = i2c_master_recv(client, skb_put(*skb, header.plen), header.plen);
        if (r != header.plen) {
index 70c304504a29d8d43d780e2327efb18aeded3ba6..9200bb308e4290ba82ad4473c6ae3e284feb69ab 100644 (file)
@@ -1035,11 +1035,10 @@ static struct sk_buff *pn533_alloc_poll_tg_frame(struct pn533 *dev)
        *skb_put(skb, 1) = PN533_INIT_TARGET_DEP;
 
        /* MIFARE params */
-       memcpy(skb_put(skb, 6), mifare_params, 6);
+       skb_put_data(skb, mifare_params, 6);
 
        /* Felica params */
-       felica = skb_put(skb, 18);
-       memcpy(felica, felica_params, 18);
+       felica = skb_put_data(skb, felica_params, 18);
        get_random_bytes(felica + 2, 6);
 
        /* NFCID3 */
@@ -1049,8 +1048,7 @@ static struct sk_buff *pn533_alloc_poll_tg_frame(struct pn533 *dev)
        /* General bytes */
        *skb_put(skb, 1) = gbytes_len;
 
-       gb = skb_put(skb, gbytes_len);
-       memcpy(gb, gbytes, gbytes_len);
+       gb = skb_put_data(skb, gbytes, gbytes_len);
 
        /* Len Tk */
        *skb_put(skb, 1) = 0;
@@ -1384,15 +1382,14 @@ static int pn533_poll_dep(struct nfc_dev *nfc_dev)
        *next = 0;
 
        /* Copy passive data */
-       memcpy(skb_put(skb, PASSIVE_DATA_LEN), passive_data, PASSIVE_DATA_LEN);
+       skb_put_data(skb, passive_data, PASSIVE_DATA_LEN);
        *next |= 1;
 
        /* Copy NFCID3 (which is NFCID2 from SENSF_RES) */
-       memcpy(skb_put(skb, NFC_NFCID3_MAXSIZE), nfcid3,
-              NFC_NFCID3_MAXSIZE);
+       skb_put_data(skb, nfcid3, NFC_NFCID3_MAXSIZE);
        *next |= 2;
 
-       memcpy(skb_put(skb, dev->gb_len), dev->gb, dev->gb_len);
+       skb_put_data(skb, dev->gb, dev->gb_len);
        *next |= 4; /* We have some Gi */
 
        rc = pn533_send_cmd_async(dev, PN533_CMD_IN_JUMP_FOR_DEP, skb,
@@ -1472,7 +1469,7 @@ static struct sk_buff *pn533_alloc_poll_in_frame(struct pn533 *dev,
        if (!skb)
                return NULL;
 
-       memcpy(skb_put(skb, mod->len), &mod->data, mod->len);
+       skb_put_data(skb, &mod->data, mod->len);
 
        return skb;
 }
@@ -1858,7 +1855,7 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
        *next = 0;
 
        /* Copy passive data */
-       memcpy(skb_put(skb, PASSIVE_DATA_LEN), passive_data, PASSIVE_DATA_LEN);
+       skb_put_data(skb, passive_data, PASSIVE_DATA_LEN);
        *next |= 1;
 
        /* Copy NFCID3 (which is NFCID2 from SENSF_RES) */
@@ -1866,12 +1863,11 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
                memcpy(skb_put(skb, NFC_NFCID3_MAXSIZE), target->nfcid2,
                       target->nfcid2_len);
        else
-               memcpy(skb_put(skb, NFC_NFCID3_MAXSIZE), nfcid3,
-                      NFC_NFCID3_MAXSIZE);
+               skb_put_data(skb, nfcid3, NFC_NFCID3_MAXSIZE);
        *next |= 2;
 
        if (gb != NULL && gb_len > 0) {
-               memcpy(skb_put(skb, gb_len), gb, gb_len);
+               skb_put_data(skb, gb, gb_len);
                *next |= 4; /* We have some Gi */
        } else {
                *next = 0;
@@ -2100,7 +2096,7 @@ static int pn533_fill_fragment_skbs(struct pn533 *dev, struct sk_buff *skb)
                                *skb_push(frag, sizeof(u8)) =  1; /* TG */
                }
 
-               memcpy(skb_put(frag, frag_size), skb->data, frag_size);
+               skb_put_data(frag, skb->data, frag_size);
 
                /* Reduce the size of incoming buffer */
                skb_pull(skb, frag_size);
@@ -2375,7 +2371,7 @@ static int pn533_set_configuration(struct pn533 *dev, u8 cfgitem, u8 *cfgdata,
                return -ENOMEM;
 
        *skb_put(skb, sizeof(cfgitem)) = cfgitem;
-       memcpy(skb_put(skb, cfgdata_len), cfgdata, cfgdata_len);
+       skb_put_data(skb, cfgdata, cfgdata_len);
 
        resp = pn533_send_cmd_sync(dev, PN533_CMD_RF_CONFIGURATION, skb);
        if (IS_ERR(resp))
index 8ed203ea21eac53cd1db08c03e046aa7bd9d6bc5..e153e8b64bb8bdd527cd4681c7cb4605d06d3f8e 100644 (file)
@@ -75,8 +75,8 @@ static void pn533_recv_response(struct urb *urb)
                if (!skb) {
                        nfc_err(&phy->udev->dev, "failed to alloc memory\n");
                } else {
-                       memcpy(skb_put(skb, urb->actual_length),
-                              urb->transfer_buffer, urb->actual_length);
+                       skb_put_data(skb, urb->transfer_buffer,
+                                    urb->actual_length);
                }
        }
 
index 19be93e177fe563fce1765e170f6752270e1aab0..e1260da73d45981e84ba9c2e29bb5a103d7589bd 100644 (file)
@@ -1089,9 +1089,8 @@ static int port100_in_set_rf(struct nfc_digital_dev *ddev, u8 rf)
        if (!skb)
                return -ENOMEM;
 
-       memcpy(skb_put(skb, sizeof(struct port100_in_rf_setting)),
-              &in_rf_settings[rf],
-              sizeof(struct port100_in_rf_setting));
+       skb_put_data(skb, &in_rf_settings[rf],
+                    sizeof(struct port100_in_rf_setting));
 
        resp = port100_send_cmd_sync(dev, PORT100_CMD_IN_SET_RF, skb);
 
@@ -1133,7 +1132,7 @@ static int port100_in_set_framing(struct nfc_digital_dev *ddev, int param)
        if (!skb)
                return -ENOMEM;
 
-       memcpy(skb_put(skb, size), protocols, size);
+       skb_put_data(skb, protocols, size);
 
        resp = port100_send_cmd_sync(dev, PORT100_CMD_IN_SET_PROTOCOL, skb);
 
@@ -1247,9 +1246,8 @@ static int port100_tg_set_rf(struct nfc_digital_dev *ddev, u8 rf)
        if (!skb)
                return -ENOMEM;
 
-       memcpy(skb_put(skb, sizeof(struct port100_tg_rf_setting)),
-              &tg_rf_settings[rf],
-              sizeof(struct port100_tg_rf_setting));
+       skb_put_data(skb, &tg_rf_settings[rf],
+                    sizeof(struct port100_tg_rf_setting));
 
        resp = port100_send_cmd_sync(dev, PORT100_CMD_TG_SET_RF, skb);
 
@@ -1291,7 +1289,7 @@ static int port100_tg_set_framing(struct nfc_digital_dev *ddev, int param)
        if (!skb)
                return -ENOMEM;
 
-       memcpy(skb_put(skb, size), protocols, size);
+       skb_put_data(skb, protocols, size);
 
        resp = port100_send_cmd_sync(dev, PORT100_CMD_TG_SET_PROTOCOL, skb);
 
index 5f97da1947e396e9252809106ea61fd26d8e1db7..38548bd970cd2aa738a916ab198ee3456b0e9cfe 100644 (file)
@@ -76,9 +76,9 @@ static int s3fwrn5_fw_prep_msg(struct s3fwrn5_fw_info *fw_info,
        if (!skb)
                return -ENOMEM;
 
-       memcpy(skb_put(skb, S3FWRN5_FW_HDR_SIZE), &hdr, S3FWRN5_FW_HDR_SIZE);
+       skb_put_data(skb, &hdr, S3FWRN5_FW_HDR_SIZE);
        if (len)
-               memcpy(skb_put(skb, len), data, len);
+               skb_put_data(skb, data, len);
 
        *msg = skb;
 
index 3ed0adf6479b07e092974c29bdba3e4f166432b6..3f09d7fd2285f3e727e9ea448fed49b72fcadaa5 100644 (file)
@@ -157,7 +157,7 @@ static int s3fwrn5_i2c_read(struct s3fwrn5_i2c_phy *phy)
        if (!skb)
                return -ENOMEM;
 
-       memcpy(skb_put(skb, hdr_size), hdr, hdr_size);
+       skb_put_data(skb, hdr, hdr_size);
 
        if (data_len == 0)
                goto out;
index 798a32bbac5ddca479592857c74753bf84a5faf6..ada7b114b6c19ad0511b7ab7a5cefa8509d6bb67 100644 (file)
@@ -564,7 +564,7 @@ int st21nfca_im_send_atr_req(struct nfc_hci_dev *hdev, u8 *gb, size_t gb_len)
        atr_req->ppi = ST21NFCA_LR_BITS_PAYLOAD_SIZE_254B;
        if (gb_len) {
                atr_req->ppi |= ST21NFCA_GB_BIT;
-               memcpy(skb_put(skb, gb_len), gb, gb_len);
+               skb_put_data(skb, gb, gb_len);
        }
        atr_req->length = sizeof(struct st21nfca_atr_req) + hdev->gb_len;
 
index 02a920ca07c8477a526856d229d286c129de72f6..94d0b913b627fa1c9699d0f3968e7e4d832698f9 100644 (file)
@@ -407,7 +407,7 @@ static int st21nfca_hci_i2c_read(struct st21nfca_i2c_phy *phy,
                        phy->current_read_len = 0;
                }
 
-               memcpy(skb_put(skb, len), buf, len);
+               skb_put_data(skb, buf, len);
 
                if (skb->data[skb->len - 1] == ST21NFCA_SOF_EOF) {
                        phy->current_read_len = 0;
index 0ca2ccc09ca6cc04c9e3cd7443dc73cd04be6ce5..2576284f99a7304c317976a8bc17f7413eecbc54 100644 (file)
@@ -116,7 +116,7 @@ static int rpmsg_ept_cb(struct rpmsg_device *rpdev, void *buf, int len,
        if (!skb)
                return -ENOMEM;
 
-       memcpy(skb_put(skb, len), buf, len);
+       skb_put_data(skb, buf, len);
 
        spin_lock(&eptdev->queue_lock);
        skb_queue_tail(&eptdev->queue, skb);
index 730d9619400e5b1515b41371e6bc6f3adfa2118f..e9847ce3860d81d51d6e8f26f1bb67220cd68783 100644 (file)
@@ -1279,7 +1279,7 @@ static void ctcmpc_chx_txdone(fsm_instance *fi, int event, void *arg)
                       __func__, data_space);
 
        while ((skb = skb_dequeue(&ch->collect_queue))) {
-               memcpy(skb_put(ch->trans_skb, skb->len), skb->data, skb->len);
+               skb_put_data(ch->trans_skb, skb->data, skb->len);
                p_header = (struct pdu *)
                        (skb_tail_pointer(ch->trans_skb) - skb->len);
                p_header->pdu_flag = 0x00;
@@ -1431,13 +1431,12 @@ static void ctcmpc_chx_rx(fsm_instance *fi, int event, void *arg)
                        break;
                case MPCG_STATE_FLOWC:
                case MPCG_STATE_READY:
-                       memcpy(skb_put(new_skb, block_len),
-                                              skb->data, block_len);
+                       skb_put_data(new_skb, skb->data, block_len);
                        skb_queue_tail(&ch->io_queue, new_skb);
                        tasklet_schedule(&ch->ch_tasklet);
                        break;
                default:
-                       memcpy(skb_put(new_skb, len), skb->data, len);
+                       skb_put_data(new_skb, skb->data, len);
                        skb_queue_tail(&ch->io_queue, new_skb);
                        tasklet_hi_schedule(&ch->ch_tasklet);
                        break;
index 198842ce6876e812b07d57ab826ca8934920bd44..99121352c57beec4bceb976f7d06e4e262dd4585 100644 (file)
@@ -522,7 +522,7 @@ static int ctcm_transmit_skb(struct channel *ch, struct sk_buff *skb)
                        ctcm_clear_busy(ch->netdev);
                        return -ENOMEM;
                } else {
-                       memcpy(skb_put(nskb, skb->len), skb->data, skb->len);
+                       skb_put_data(nskb, skb->data, skb->len);
                        atomic_inc(&nskb->users);
                        atomic_dec(&skb->users);
                        dev_kfree_skb_irq(skb);
@@ -638,7 +638,7 @@ static void ctcmpc_send_sweep_req(struct channel *rch)
        header->th.th_seq_num   = 0x00;
        header->sw.th_last_seq  = ch->th_seq_num;
 
-       memcpy(skb_put(sweep_skb, TH_SWEEP_LENGTH), header, TH_SWEEP_LENGTH);
+       skb_put_data(sweep_skb, header, TH_SWEEP_LENGTH);
 
        kfree(header);
 
@@ -728,7 +728,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
                if (!nskb) {
                        goto nomem_exit;
                } else {
-                       memcpy(skb_put(nskb, skb->len), skb->data, skb->len);
+                       skb_put_data(nskb, skb->data, skb->len);
                        atomic_inc(&nskb->users);
                        atomic_dec(&skb->users);
                        dev_kfree_skb_irq(skb);
@@ -809,7 +809,7 @@ static int ctcmpc_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_put_data(ch->trans_skb, skb->data, skb->len);
                atomic_dec(&skb->users);
                dev_kfree_skb_irq(skb);
                ccw_idx = 0;
@@ -960,7 +960,7 @@ static int ctcmpc_tx(struct sk_buff *skb, struct net_device *dev)
                }
                newskb->protocol = skb->protocol;
                skb_reserve(newskb, TH_HEADER_LENGTH + PDU_HEADER_LENGTH);
-               memcpy(skb_put(newskb, skb->len), skb->data, skb->len);
+               skb_put_data(newskb, skb->data, skb->len);
                dev_kfree_skb_any(skb);
                skb = newskb;
        }
index c103fc7efe9fd4384edaa6365d83805267733d07..f8be39634f03c81c68a8e4d102db73b2fb665f59 100644 (file)
@@ -667,7 +667,7 @@ static void ctcmpc_send_sweep_resp(struct channel *rch)
        header->th.th_seq_num   = 0x00;
        header->sw.th_last_seq  = ch->th_seq_num;
 
-       memcpy(skb_put(sweep_skb, TH_SWEEP_LENGTH), header, TH_SWEEP_LENGTH);
+       skb_put_data(sweep_skb, header, TH_SWEEP_LENGTH);
 
        kfree(header);
 
@@ -974,9 +974,8 @@ void mpc_channel_action(struct channel *ch, int direction, int action)
                skb_reset_tail_pointer(ch->xid_skb);
                ch->xid_skb->len = 0;
 
-               memcpy(skb_put(ch->xid_skb, grp->xid_skb->len),
-                               grp->xid_skb->data,
-                               grp->xid_skb->len);
+               skb_put_data(ch->xid_skb, grp->xid_skb->data,
+                            grp->xid_skb->len);
 
                ch->xid->xid2_dlc_type =
                        ((CHANNEL_DIRECTION(ch->flags) == CTCM_READ)
@@ -1149,7 +1148,7 @@ static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
                                fsm_event(grp->fsm, MPCG_EVENT_INOP, dev);
                                                goto done;
                        }
-                       memcpy(skb_put(skb, new_len), pskb->data, new_len);
+                       skb_put_data(skb, pskb->data, new_len);
 
                        skb_reset_mac_header(skb);
                        skb->dev = pskb->dev;
@@ -1297,16 +1296,15 @@ struct mpc_group *ctcmpc_init_mpc_group(struct ctcm_priv *priv)
        /*  base xid for all channels in group  */
        grp->xid_skb_data = grp->xid_skb->data;
        grp->xid_th = (struct th_header *)grp->xid_skb->data;
-       memcpy(skb_put(grp->xid_skb, TH_HEADER_LENGTH),
-                       &thnorm, TH_HEADER_LENGTH);
+       skb_put_data(grp->xid_skb, &thnorm, TH_HEADER_LENGTH);
 
        grp->xid = (struct xid2 *)skb_tail_pointer(grp->xid_skb);
-       memcpy(skb_put(grp->xid_skb, XID2_LENGTH), &init_xid, XID2_LENGTH);
+       skb_put_data(grp->xid_skb, &init_xid, XID2_LENGTH);
        grp->xid->xid2_adj_id = jiffies | 0xfff00000;
        grp->xid->xid2_sender_id = jiffies;
 
        grp->xid_id = skb_tail_pointer(grp->xid_skb);
-       memcpy(skb_put(grp->xid_skb, 4), "VTAM", 4);
+       skb_put_data(grp->xid_skb, "VTAM", 4);
 
        grp->rcvd_xid_skb =
                __dev_alloc_skb(MPC_BUFSIZE_DEFAULT, GFP_ATOMIC|GFP_DMA);
@@ -1318,8 +1316,7 @@ struct mpc_group *ctcmpc_init_mpc_group(struct ctcm_priv *priv)
        }
        grp->rcvd_xid_data = grp->rcvd_xid_skb->data;
        grp->rcvd_xid_th = (struct th_header *)grp->rcvd_xid_skb->data;
-       memcpy(skb_put(grp->rcvd_xid_skb, TH_HEADER_LENGTH),
-                       &thnorm, TH_HEADER_LENGTH);
+       skb_put_data(grp->rcvd_xid_skb, &thnorm, TH_HEADER_LENGTH);
        grp->saved_xid2 = NULL;
        priv->xid = grp->xid;
        priv->mpcg = grp;
@@ -1410,8 +1407,7 @@ static void mpc_action_go_inop(fsm_instance *fi, int event, void *arg)
        skb_reset_tail_pointer(grp->rcvd_xid_skb);
        grp->rcvd_xid_skb->len = 0;
        grp->rcvd_xid_th = (struct th_header *)grp->rcvd_xid_skb->data;
-       memcpy(skb_put(grp->rcvd_xid_skb, TH_HEADER_LENGTH), &thnorm,
-              TH_HEADER_LENGTH);
+       skb_put_data(grp->rcvd_xid_skb, &thnorm, TH_HEADER_LENGTH);
 
        if (grp->send_qllc_disc == 1) {
                grp->send_qllc_disc = 0;
@@ -1590,8 +1586,7 @@ static int mpc_validate_xid(struct mpcg_info *mpcginfo)
                grp->saved_xid2 =
                        (struct xid2 *)skb_tail_pointer(grp->rcvd_xid_skb);
 
-               memcpy(skb_put(grp->rcvd_xid_skb,
-                                       XID2_LENGTH), xid, XID2_LENGTH);
+               skb_put_data(grp->rcvd_xid_skb, xid, XID2_LENGTH);
                grp->rcvd_xid_skb->data = grp->rcvd_xid_data;
 
                skb_reset_tail_pointer(grp->rcvd_xid_skb);
@@ -1908,17 +1903,15 @@ static void mpc_action_doxid7(fsm_instance *fsm, int event, void *arg)
                                if (fsm_getstate(ch->fsm) == CH_XID7_PENDING1) {
                                        fsm_newstate(ch->fsm, CH_XID7_PENDING2);
                                        ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD;
-                                       memcpy(skb_put(ch->xid_skb,
-                                                       TH_HEADER_LENGTH),
-                                              &thdummy, TH_HEADER_LENGTH);
+                                       skb_put_data(ch->xid_skb, &thdummy,
+                                                    TH_HEADER_LENGTH);
                                        send = 1;
                                }
                        } else if (fsm_getstate(ch->fsm) < CH_XID7_PENDING2) {
                                        fsm_newstate(ch->fsm, CH_XID7_PENDING2);
                                        ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL;
-                                       memcpy(skb_put(ch->xid_skb,
-                                                      TH_HEADER_LENGTH),
-                                              &thnorm, TH_HEADER_LENGTH);
+                                       skb_put_data(ch->xid_skb, &thnorm,
+                                                    TH_HEADER_LENGTH);
                                        send = 1;
                        }
                } else {
@@ -1926,17 +1919,16 @@ static void mpc_action_doxid7(fsm_instance *fsm, int event, void *arg)
                        if (grp->roll == YSIDE) {
                                if (fsm_getstate(ch->fsm) < CH_XID7_PENDING4) {
                                        fsm_newstate(ch->fsm, CH_XID7_PENDING4);
-                                       memcpy(skb_put(ch->xid_skb,
-                                                      TH_HEADER_LENGTH),
-                                              &thnorm, TH_HEADER_LENGTH);
+                                       skb_put_data(ch->xid_skb, &thnorm,
+                                                    TH_HEADER_LENGTH);
                                        ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL;
                                        send = 1;
                                }
                        } else if (fsm_getstate(ch->fsm) == CH_XID7_PENDING3) {
                                fsm_newstate(ch->fsm, CH_XID7_PENDING4);
                                ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD;
-                               memcpy(skb_put(ch->xid_skb, TH_HEADER_LENGTH),
-                                               &thdummy, TH_HEADER_LENGTH);
+                               skb_put_data(ch->xid_skb, &thdummy,
+                                            TH_HEADER_LENGTH);
                                send = 1;
                        }
                }
@@ -2122,7 +2114,7 @@ static int mpc_send_qllc_discontact(struct net_device *dev)
                        return -ENOMEM;
                }
 
-               memcpy(skb_put(skb, new_len), qllcptr, new_len);
+               skb_put_data(skb, qllcptr, new_len);
                kfree(qllcptr);
 
                if (skb_headroom(skb) < 4) {
index 211b31d9f157dfeb16441d6852b85b319083e095..337bacb43d685dfe5c5f9cd970a462e36482f73a 100644 (file)
@@ -1796,7 +1796,7 @@ lcs_get_skb(struct lcs_card *card, char *skb_data, unsigned int skb_len)
                card->stats.rx_dropped++;
                return;
        }
-       memcpy(skb_put(skb, skb_len), skb_data, skb_len);
+       skb_put_data(skb, skb_data, skb_len);
        skb->protocol = card->lan_type_trans(skb, card->dev);
        card->stats.rx_bytes += skb_len;
        card->stats.rx_packets++;
index fa732bd8672961ce89c911f5e60212db1e2da386..7db427c0a6a46bf8190ba3b9ccb0453422a1d337 100644 (file)
@@ -759,8 +759,7 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg)
        spin_lock_irqsave(&conn->collect_lock, saveflags);
        while ((skb = skb_dequeue(&conn->collect_queue))) {
                header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN;
-               memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header,
-                      NETIUCV_HDRLEN);
+               skb_put_data(conn->tx_buff, &header, NETIUCV_HDRLEN);
                skb_copy_from_linear_data(skb,
                                          skb_put(conn->tx_buff, skb->len),
                                          skb->len);
@@ -780,7 +779,7 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg)
        }
 
        header.next = 0;
-       memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN);
+       skb_put_data(conn->tx_buff, &header, NETIUCV_HDRLEN);
        conn->prof.send_stamp = jiffies;
        txmsg.class = 0;
        txmsg.tag = 0;
@@ -1201,8 +1200,7 @@ static int netiucv_transmit_skb(struct iucv_connection *conn,
                                return rc;
                        } else {
                                skb_reserve(nskb, NETIUCV_HDRLEN);
-                               memcpy(skb_put(nskb, skb->len),
-                                      skb->data, skb->len);
+                               skb_put_data(nskb, skb->data, skb->len);
                        }
                        copied = 1;
                }
@@ -1212,7 +1210,7 @@ static int netiucv_transmit_skb(struct iucv_connection *conn,
                header.next = nskb->len + NETIUCV_HDRLEN;
                memcpy(skb_push(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN);
                header.next = 0;
-               memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header,  NETIUCV_HDRLEN);
+               skb_put_data(nskb, &header, NETIUCV_HDRLEN);
 
                fsm_newstate(conn->fsm, CONN_STATE_TX);
                conn->prof.send_stamp = jiffies;
index 1fb92e870040c65092bd55db43faa91ec8b246cd..08338f27c82cf466ea3b64d04b25a232325bb9c9 100644 (file)
@@ -5147,12 +5147,11 @@ static inline int qeth_create_skb_frag(struct qeth_qdio_buffer *qethbuffer,
 
                skb_reserve(*pskb, ETH_HLEN);
                if (data_len <= QETH_RX_PULL_LEN) {
-                       memcpy(skb_put(*pskb, data_len), element->addr + offset,
-                               data_len);
+                       skb_put_data(*pskb, element->addr + offset, data_len);
                } else {
                        get_page(page);
-                       memcpy(skb_put(*pskb, QETH_RX_PULL_LEN),
-                              element->addr + offset, QETH_RX_PULL_LEN);
+                       skb_put_data(*pskb, element->addr + offset,
+                                    QETH_RX_PULL_LEN);
                        skb_fill_page_desc(*pskb, *pfrag, page,
                                offset + QETH_RX_PULL_LEN,
                                data_len - QETH_RX_PULL_LEN);
@@ -5248,8 +5247,7 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
                                    &skb, offset, &frag, data_len))
                                        goto no_mem;
                        } else {
-                               memcpy(skb_put(skb, data_len), data_ptr,
-                                       data_len);
+                               skb_put_data(skb, data_ptr, data_len);
                        }
                }
                skb_len -= data_len;
index cf809987f79f5417b7634101ee9c4cdf607deac3..9ab6ce231f117ed8334c1e00ade1c509b6b190ab 100644 (file)
@@ -161,12 +161,9 @@ static int gdm_lte_emulate_arp(struct sk_buff *skb_in, u32 nic_type)
                return -ENOMEM;
        skb_reserve(skb_out, NET_IP_ALIGN);
 
-       memcpy(skb_put(skb_out, mac_header_len), mac_header_data,
-              mac_header_len);
-       memcpy(skb_put(skb_out, sizeof(struct arphdr)), arp_out,
-              sizeof(struct arphdr));
-       memcpy(skb_put(skb_out, sizeof(struct arpdata)), arp_data_out,
-              sizeof(struct arpdata));
+       skb_put_data(skb_out, mac_header_data, mac_header_len);
+       skb_put_data(skb_out, arp_out, sizeof(struct arphdr));
+       skb_put_data(skb_out, arp_data_out, sizeof(struct arpdata));
 
        skb_out->protocol = ((struct ethhdr *)mac_header_data)->h_proto;
        skb_out->dev = skb_in->dev;
@@ -322,14 +319,10 @@ static int gdm_lte_emulate_ndp(struct sk_buff *skb_in, u32 nic_type)
                return -ENOMEM;
        skb_reserve(skb_out, NET_IP_ALIGN);
 
-       memcpy(skb_put(skb_out, mac_header_len), mac_header_data,
-              mac_header_len);
-       memcpy(skb_put(skb_out, sizeof(struct ipv6hdr)), &ipv6_out,
-              sizeof(struct ipv6hdr));
-       memcpy(skb_put(skb_out, sizeof(struct icmp6hdr)), &icmp6_out,
-              sizeof(struct icmp6hdr));
-       memcpy(skb_put(skb_out, sizeof(struct neighbour_advertisement)), &na,
-              sizeof(struct neighbour_advertisement));
+       skb_put_data(skb_out, mac_header_data, mac_header_len);
+       skb_put_data(skb_out, &ipv6_out, sizeof(struct ipv6hdr));
+       skb_put_data(skb_out, &icmp6_out, sizeof(struct icmp6hdr));
+       skb_put_data(skb_out, &na, sizeof(struct neighbour_advertisement));
 
        skb_out->protocol = ((struct ethhdr *)mac_header_data)->h_proto;
        skb_out->dev = skb_in->dev;
@@ -669,8 +662,8 @@ static void gdm_lte_netif_rx(struct net_device *dev, char *buf,
                return;
        skb_reserve(skb, NET_IP_ALIGN);
 
-       memcpy(skb_put(skb, mac_header_len), mac_header_data, mac_header_len);
-       memcpy(skb_put(skb, len), buf, len);
+       skb_put_data(skb, mac_header_data, mac_header_len);
+       skb_put_data(skb, buf, len);
 
        skb->protocol = ((struct ethhdr *)mac_header_data)->h_proto;
        skb->dev = dev;
index 49e95426ac30a6d9e48725f6c4eda48cb3277654..da801d3e0585d27bce1fa292c94c43519c5eca21 100644 (file)
@@ -466,12 +466,12 @@ void hostif_data_indication(struct ks_wlan_private *priv)
                DPRINTK(4, "SNAP, rx_ind_size = %d\n", rx_ind_size);
 
                size = ETH_ALEN * 2;
-               memcpy(skb_put(skb, size), priv->rxp, size);
+               skb_put_data(skb, priv->rxp, size);
 
                /* (SNAP+UI..) skip */
 
                size = rx_ind_size - (ETH_ALEN * 2);
-               memcpy(skb_put(skb, size), &eth_hdr->h_proto, size);
+               skb_put_data(skb, &eth_hdr->h_proto, size);
 
                aa1x_hdr = (struct ieee802_1x_hdr *)(priv->rxp + ETHER_HDR_SIZE);
                break;
@@ -484,14 +484,13 @@ void hostif_data_indication(struct ks_wlan_private *priv)
                }
                DPRINTK(3, "NETBEUI/NetBIOS rx_ind_size=%d\n", rx_ind_size);
 
-               memcpy(skb_put(skb, 12), priv->rxp, 12);        /* 8802/FDDI MAC copy */
+               skb_put_data(skb, priv->rxp, 12);       /* 8802/FDDI MAC copy */
 
                temp[0] = (((rx_ind_size - 12) >> 8) & 0xff);   /* NETBEUI size add */
                temp[1] = ((rx_ind_size - 12) & 0xff);
-               memcpy(skb_put(skb, 2), temp, 2);
+               skb_put_data(skb, temp, 2);
 
-               memcpy(skb_put(skb, rx_ind_size - 14), priv->rxp + 12,
-                      rx_ind_size - 14);       /* copy after Type */
+               skb_put_data(skb, priv->rxp + 12, rx_ind_size - 14);    /* copy after Type */
 
                aa1x_hdr = (struct ieee802_1x_hdr *)(priv->rxp + 14);
                break;
index ce1764cba5f0ffdb66d3e7ddbab8a1b7a6e6c1ab..995674f25172fc35e60b494fd0f00368f4d1779c 100644 (file)
@@ -486,11 +486,11 @@ static int aim_rx_data(struct mbo *mbo)
                ether_addr_copy(skb_put(skb, ETH_ALEN), dev->dev_addr);
 
                /* src */
-               memcpy(skb_put(skb, 4), &zero, 4);
-               memcpy(skb_put(skb, 2), buf + 5, 2);
+               skb_put_data(skb, &zero, 4);
+               skb_put_data(skb, buf + 5, 2);
 
                /* eth type */
-               memcpy(skb_put(skb, 2), buf + 10, 2);
+               skb_put_data(skb, buf + 10, 2);
 
                buf += MDP_HDR_LEN;
                len -= MDP_HDR_LEN;
@@ -499,7 +499,7 @@ static int aim_rx_data(struct mbo *mbo)
                len -= MEP_HDR_LEN;
        }
 
-       memcpy(skb_put(skb, len), buf, len);
+       skb_put_data(skb, buf, len);
        skb->protocol = eth_type_trans(skb, dev);
        skb_len = skb->len;
        if (netif_rx(skb) == NET_RX_SUCCESS) {
index 65a2856319948e4c3fb184814334c651f4f9eed4..72baedefa0f12fb7310307b02f4ef439c96623dc 100644 (file)
@@ -287,8 +287,7 @@ static int cvm_oct_poll(struct oct_rx_group *rx_group, int budget)
                                        else
                                                ptr += 6;
                                }
-                               memcpy(skb_put(skb, work->word1.len), ptr,
-                                      work->word1.len);
+                               skb_put_data(skb, ptr, work->word1.len);
                                /* No packet buffers to free */
                        } else {
                                int segments = work->word2.s.bufs;
@@ -323,10 +322,9 @@ static int cvm_oct_poll(struct oct_rx_group *rx_group, int budget)
                                        if (segment_size > len)
                                                segment_size = len;
                                        /* Copy the data into the packet */
-                                       memcpy(skb_put(skb, segment_size),
-                                              cvmx_phys_to_ptr(
-                                              segment_ptr.s.addr),
-                                              segment_size);
+                                       skb_put_data(skb,
+                                                    cvmx_phys_to_ptr(segment_ptr.s.addr),
+                                                    segment_size);
                                        len -= segment_size;
                                        segment_ptr = next_ptr;
                                }
index c6c4404e717b9195019ef6dcaad850c5760052d4..14173cf6e1e76ff173f068dd5ba024b96aeae0e8 100644 (file)
@@ -1544,8 +1544,8 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)
                sub_skb = dev_alloc_skb(nSubframe_Length + 12);
                if (sub_skb) {
                        skb_reserve(sub_skb, 12);
-                       data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
-                       memcpy(data_ptr, pdata, nSubframe_Length);
+                       data_ptr = skb_put_data(sub_skb, pdata,
+                                               nSubframe_Length);
                } else {
                        sub_skb = skb_clone(prframe->pkt, GFP_ATOMIC);
                        if (sub_skb) {
index 859d0d6051cdf6748d298a8f547aff141e5c55c6..225c23fc69dce80fde5f96620ec8e33dac3d1f6e 100644 (file)
@@ -53,7 +53,7 @@ static void mon_recv_decrypted(struct net_device *dev, const u8 *data,
        skb = netdev_alloc_skb(dev, data_len);
        if (!skb)
                return;
-       memcpy(skb_put(skb, data_len), data, data_len);
+       skb_put_data(skb, data, data_len);
 
        /*
         * Frame data is not encrypted. Strip off protection so
index 43a77745e6fbe51a170da4f7cc921a9d44ea9f07..bae98ca0a9b6df292279b9e9e9df93b95cb1266d 100644 (file)
@@ -817,8 +817,7 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
                if (!sub_skb)
                        return 0;
                skb_reserve(sub_skb, 12);
-               data_ptr = (u8 *)skb_put(sub_skb, skb->len);
-               memcpy(data_ptr, skb->data, skb->len);
+               data_ptr = skb_put_data(sub_skb, skb->data, skb->len);
                sub_skb->dev = ieee->dev;
 
                rxb->subframes[0] = sub_skb;
@@ -870,8 +869,7 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
                if (!sub_skb)
                        return 0;
                skb_reserve(sub_skb, 12);
-               data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
-               memcpy(data_ptr, skb->data, nSubframe_Length);
+               data_ptr = skb_put_data(sub_skb, skb->data, nSubframe_Length);
 
                sub_skb->dev = ieee->dev;
                rxb->subframes[rxb->nr_subframes++] = sub_skb;
@@ -1141,13 +1139,12 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
                        /* copy first fragment (including full headers) into
                         * beginning of the fragment cache skb
                         */
-                       memcpy(skb_put(frag_skb, flen), skb->data, flen);
+                       skb_put_data(frag_skb, skb->data, flen);
                } else {
                        /* append frame payload to the end of the fragment
                         * cache skb
                         */
-                       memcpy(skb_put(frag_skb, flen), skb->data + hdrlen,
-                              flen);
+                       skb_put_data(frag_skb, skb->data + hdrlen, flen);
                }
                dev_kfree_skb_any(skb);
                skb = NULL;
index eeda17d6409b1c6901df93c49cddc0c7e9ba5651..60d07d0bb4eb82d76c7e4d330f5530cc906bd5b2 100644 (file)
@@ -1272,8 +1272,7 @@ rtllib_association_req(struct rtllib_network *beacon,
        hdr->info_element[0].id = MFIE_TYPE_SSID;
 
        hdr->info_element[0].len = beacon->ssid_len;
-       tag = skb_put(skb, beacon->ssid_len);
-       memcpy(tag, beacon->ssid, beacon->ssid_len);
+       tag = skb_put_data(skb, beacon->ssid, beacon->ssid_len);
 
        tag = skb_put(skb, rate_len);
 
@@ -1349,8 +1348,7 @@ rtllib_association_req(struct rtllib_network *beacon,
        }
 
        if (wpa_ie_len) {
-               tag = skb_put(skb, ieee->wpa_ie_len);
-               memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len);
+               tag = skb_put_data(skb, ieee->wpa_ie, ieee->wpa_ie_len);
 
                if (PMKCacheIdx >= 0) {
                        tag = skb_put(skb, 18);
@@ -1366,8 +1364,7 @@ rtllib_association_req(struct rtllib_network *beacon,
        }
 
        if (wps_ie_len && ieee->wps_ie) {
-               tag = skb_put(skb, wps_ie_len);
-               memcpy(tag, ieee->wps_ie, wps_ie_len);
+               tag = skb_put_data(skb, ieee->wps_ie, wps_ie_len);
        }
 
        tag = skb_put(skb, turbo_info_len);
index 78a3ad5b231f1e34b0143532e2b839cd63ce0a82..fc88d47dea43fa4e57290f3da7c9b015b472cd14 100644 (file)
@@ -624,8 +624,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
 
                        txb->encrypted = 0;
                        txb->payload_size = cpu_to_le16(skb->len);
-                       memcpy(skb_put(txb->fragments[0], skb->len), skb->data,
-                              skb->len);
+                       skb_put_data(txb->fragments[0], skb->data, skb->len);
 
                        goto success;
                }
@@ -818,9 +817,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
                        } else {
                                tcb_desc->bHwSec = 0;
                        }
-                       frag_hdr = (struct rtllib_hdr_3addrqos *)
-                                  skb_put(skb_frag, hdr_len);
-                       memcpy(frag_hdr, &header, hdr_len);
+                       frag_hdr = skb_put_data(skb_frag, &header, hdr_len);
 
                        /* If this is not the last fragment, then add the
                         * MOREFRAGS bit to the frame control
@@ -852,7 +849,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
                                bytes -= SNAP_SIZE + sizeof(u16);
                        }
 
-                       memcpy(skb_put(skb_frag, bytes), skb->data, bytes);
+                       skb_put_data(skb_frag, skb->data, bytes);
 
                        /* Advance the SKB... */
                        skb_pull(skb, bytes);
@@ -895,8 +892,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
 
                txb->encrypted = 0;
                txb->payload_size = cpu_to_le16(skb->len);
-               memcpy(skb_put(txb->fragments[0], skb->len), skb->data,
-                      skb->len);
+               skb_put_data(txb->fragments[0], skb->data, skb->len);
        }
 
  success:
index 7a31510f0524e59d4c1672843f758ccf2d1d3350..c0e2f711cb4ef2464cc450f1f88711586ef62e18 100644 (file)
@@ -848,8 +848,8 @@ static u8 parse_subframe(struct sk_buff *skb,
                        if (!sub_skb)
                                return 0;
                        skb_reserve(sub_skb, 12);
-                       data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
-                       memcpy(data_ptr, skb->data, nSubframe_Length);
+                       data_ptr = skb_put_data(sub_skb, skb->data,
+                                               nSubframe_Length);
 #endif
                        rxb->subframes[rxb->nr_subframes++] = sub_skb;
                        if (rxb->nr_subframes >= MAX_SUBFRAME_COUNT) {
@@ -1180,12 +1180,11 @@ 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_put_data(frag_skb, skb->data, flen);
                } else {
                        /* append frame payload to the end of the fragment
                         * cache skb */
-                       memcpy(skb_put(frag_skb, flen), skb->data + hdrlen,
-                              flen);
+                       skb_put_data(frag_skb, skb->data + hdrlen, flen);
                }
                dev_kfree_skb_any(skb);
                skb = NULL;
index 14aea26804f4a55557eec18441938104f9cf4c2c..903a1d0269df284f2c090b9a2fc19faaf1a1de11 100644 (file)
@@ -1115,8 +1115,7 @@ ieee80211_association_req(struct ieee80211_network *beacon,
        hdr->info_element[0].id = MFIE_TYPE_SSID;
 
        hdr->info_element[0].len = beacon->ssid_len;
-       tag = skb_put(skb, beacon->ssid_len);
-       memcpy(tag, beacon->ssid, beacon->ssid_len);
+       tag = skb_put_data(skb, beacon->ssid, beacon->ssid_len);
 
        tag = skb_put(skb, rate_len);
 
index bdb96a45a9eb40f7b0f0dd0fca4d677b5e83e2fe..f58971a4a2e31a30c10f3514200b065d14eb5eae 100644 (file)
@@ -794,8 +794,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
                        {
                                tcb_desc->bHwSec = 0;
                        }
-                       frag_hdr = (struct rtl_80211_hdr_3addrqos *)skb_put(skb_frag, hdr_len);
-                       memcpy(frag_hdr, &header, hdr_len);
+                       frag_hdr = skb_put_data(skb_frag, &header, hdr_len);
 
                        /* If this is not the last fragment, then add the MOREFRAGS
                         * bit to the frame control
@@ -826,7 +825,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_put_data(skb_frag, skb->data, bytes);
 
                        /* Advance the SKB... */
                        skb_pull(skb, bytes);
@@ -869,7 +868,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
 
                txb->encrypted = 0;
                txb->payload_size = __cpu_to_le16(skb->len);
-               memcpy(skb_put(txb->fragments[0],skb->len), skb->data, skb->len);
+               skb_put_data(txb->fragments[0], skb->data, skb->len);
        }
 
  success:
index bb6d8bd6c7acc405da397639a8ff96e1af8da1e9..c3cf01c842a3fa130bc4b9fc7c1f0970cb550386 100644 (file)
@@ -45,8 +45,7 @@ rt_status SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen)
        tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_NORMAL;
        tcb_desc->bLastIniPkt = 0;
        skb_reserve(skb, USB_HWDESC_HEADER_LEN);
-       ptr_buf = skb_put(skb, DataLen);
-       memcpy(ptr_buf, pData, DataLen);
+       ptr_buf = skb_put_data(skb, pData, DataLen);
        tcb_desc->txbuf_size = (u16)DataLen;
 
        if (!priv->ieee80211->check_nic_enough_desc(dev, tcb_desc->queue_index) ||
index 266ffefd55ed6734a7e0cd5816646001d69b8e4f..f96c558b3c6ad5e04cd83ce1ec5a89d33f7b5d52 100644 (file)
@@ -372,8 +372,7 @@ static int amsdu_to_msdu(struct _adapter *padapter, union recv_frame *prframe)
                if (!sub_skb)
                        break;
                skb_reserve(sub_skb, 12);
-               data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
-               memcpy(data_ptr, pdata, nSubframe_Length);
+               data_ptr = skb_put_data(sub_skb, pdata, nSubframe_Length);
                subframes[nr_subframes++] = sub_skb;
                if (nr_subframes >= MAX_SUBFRAME_COUNT) {
                        netdev_warn(padapter->pnetdev, "r8712u: ParseSubframe(): Too many Subframes! Packets dropped!\n");
index e731ab4e2bd7b42d1c64be2a712ec06c358e2361..1a6443dc3ff015db19aaa0049e23d1f430bbfb95 100644 (file)
@@ -82,8 +82,8 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
        if (sub_skb)
        {
                skb_reserve(sub_skb, 12);
-               data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
-               memcpy(data_ptr, (pdata + ETH_HLEN), nSubframe_Length);
+               data_ptr = skb_put_data(sub_skb, (pdata + ETH_HLEN),
+                                       nSubframe_Length);
        }
        else
        {
index c9782d452b0701a332f8487e927991280639cf5d..dbc266a379748a5b76730c052d1cb75148a3d106 100644 (file)
@@ -72,7 +72,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
                if (!skb)
                        return;
 
-               memcpy(skb_put(skb, size), buff, size);
+               skb_put_data(skb, buff, size);
 
                cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *)skb_push(skb, sizeof(*cb_hdr));
                memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr));
@@ -100,7 +100,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
                if (!skb)
                        return;
 
-               memcpy(skb_put(skb, size), buff, size);
+               skb_put_data(skb, buff, size);
                hdr = (struct wilc_wfi_radiotap_hdr *)skb_push(skb, sizeof(*hdr));
                memset(hdr, 0, sizeof(struct wilc_wfi_radiotap_hdr));
                hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */
@@ -200,7 +200,7 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
                if (!skb2)
                        return -ENOMEM;
 
-               memcpy(skb_put(skb2, skb->len), skb->data, skb->len);
+               skb_put_data(skb2, skb->data, skb->len);
 
                cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *)skb_push(skb2, sizeof(*cb_hdr));
                memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr));
index d6d803416be280a65e4179e70735c823c26d1726..f36598a89ce0d5081903cfb696a39d813b20adca 100644 (file)
@@ -1160,7 +1160,7 @@ void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
 
                skb->dev = wilc_netdev;
 
-               memcpy(skb_put(skb, frame_len), buff_to_send, frame_len);
+               skb_put_data(skb, buff_to_send, frame_len);
 
                skb->protocol = eth_type_trans(skb, wilc_netdev);
                vif->netstats.rx_packets++;
index a812e55ba1b0b8433b0c7e748a84c9eda058fb27..1de67f209f2ca3b359c0e8678a2d0f6b950413a1 100644 (file)
@@ -3530,13 +3530,11 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
        /* Copy the 802.11 header to the skb
         * (ctl frames may be less than a full header)
         */
-       datap = skb_put(skb, hdrlen);
-       memcpy(datap, &rxdesc->frame_control, hdrlen);
+       datap = skb_put_data(skb, &rxdesc->frame_control, hdrlen);
 
        /* If any, copy the data from the card to the skb */
        if (datalen > 0) {
-               datap = skb_put(skb, datalen);
-               memcpy(datap, rxfrm->data, datalen);
+               datap = skb_put_data(skb, rxfrm->data, datalen);
 
                /* check for unencrypted stuff if WEP bit set. */
                if (*(datap - hdrlen + 1) & 0x40)       /* wep set */
index c0dfb642383b29015a81c760a12b06b0452aaa65..c2f9a3263b37d43be6f6e109740e36438167baa8 100644 (file)
@@ -355,7 +355,7 @@ static struct sk_buff *ipw_packet_received_skb(unsigned char *data,
        if (skb == NULL)
                return NULL;
        skb_reserve(skb, 2);
-       memcpy(skb_put(skb, length), data, length);
+       skb_put_data(skb, data, length);
 
        return skb;
 }
index 2667a205a5abcf47ed4ab059ff350b5f35ea3fe1..da830f833392b2ef7d03d2b3a3a614123a3dd577 100644 (file)
@@ -2688,7 +2688,7 @@ static void gsm_mux_rx_netchar(struct gsm_dlci *dlci,
                return;
        }
        skb_reserve(skb, NET_IP_ALIGN);
-       memcpy(skb_put(skb, size), in_buf, size);
+       skb_put_data(skb, in_buf, size);
 
        skb->dev = net;
        skb->protocol = htons(ETH_P_IP);
index a2c308f7d6374515bf8a0ac0a9e6ea8b59f5032b..3fafc5a1b2e0387c5c160f7c213b56c60e34a7ea 100644 (file)
@@ -7960,7 +7960,7 @@ static void hdlcdev_rx(struct mgsl_struct *info, char *buf, int size)
                return;
        }
 
-       memcpy(skb_put(skb, size), buf, size);
+       skb_put_data(skb, buf, size);
 
        skb->protocol = hdlc_type_trans(skb, dev);
 
index 31885f20fc1583178f9d3108bce20009eca99cb8..7e947ecf15f16546e53dec3e76fcca3d862a22ff 100644 (file)
@@ -1755,7 +1755,7 @@ static void hdlcdev_rx(struct slgt_info *info, char *buf, int size)
                return;
        }
 
-       memcpy(skb_put(skb, size), buf, size);
+       skb_put_data(skb, buf, size);
 
        skb->protocol = hdlc_type_trans(skb, dev);
 
index 51e8846cd68fce28f0544c2f16424560dfaf787b..9b4fb0251c1ab81552c3ac5a3b32be294d06051b 100644 (file)
@@ -1874,7 +1874,7 @@ static void hdlcdev_rx(SLMP_INFO *info, char *buf, int size)
                return;
        }
 
-       memcpy(skb_put(skb, size), buf, size);
+       skb_put_data(skb, buf, size);
 
        skb->protocol = hdlc_type_trans(skb, dev);
 
index 2882c6d3ae668a99fe90de2d7cbb9787d5c39285..630616aaa861334d9ac6f07e8f446ea9ca73831b 100644 (file)
@@ -1007,8 +1007,8 @@ static struct sk_buff *package_for_tx(struct f_ncm *ncm)
        ntb_iter = skb_put_zero(skb2, ndp_pad);
 
        /* Copy NTB across. */
-       ntb_iter = (void *) skb_put(skb2, ncm->skb_tx_ndp->len);
-       memcpy(ntb_iter, ncm->skb_tx_ndp->data, ncm->skb_tx_ndp->len);
+       ntb_iter = skb_put_data(skb2, ncm->skb_tx_ndp->data,
+                               ncm->skb_tx_ndp->len);
        dev_consume_skb_any(ncm->skb_tx_ndp);
        ncm->skb_tx_ndp = NULL;
 
@@ -1129,8 +1129,7 @@ static struct sk_buff *ncm_wrap_ntb(struct gether *port,
 
                /* Add the new data to the skb */
                ntb_data = skb_put_zero(ncm->skb_tx_data, dgram_pad);
-               ntb_data = (void *) skb_put(ncm->skb_tx_data, skb->len);
-               memcpy(ntb_data, skb->data, skb->len);
+               ntb_data = skb_put_data(ncm->skb_tx_data, skb->data, skb->len);
                dev_consume_skb_any(skb);
                skb = NULL;
 
@@ -1313,8 +1312,8 @@ static int ncm_unwrap_ntb(struct gether *port,
                                                         dg_len - crc_len);
                        if (skb2 == NULL)
                                goto err;
-                       memcpy(skb_put(skb2, dg_len - crc_len),
-                              skb->data + index, dg_len - crc_len);
+                       skb_put_data(skb2, skb->data + index,
+                                    dg_len - crc_len);
 
                        skb_queue_tail(list, skb2);
 
index 6a1ce6a551587f232207612404df80807af215cd..9c4c58e4a1a287d16dad907fca178b527e885bea 100644 (file)
@@ -336,7 +336,7 @@ static void pn_rx_complete(struct usb_ep *ep, struct usb_request *req)
                        skb->protocol = htons(ETH_P_PHONET);
                        skb_reset_mac_header(skb);
                        /* Can't use pskb_pull() on page in IRQ */
-                       memcpy(skb_put(skb, 1), page_address(page), 1);
+                       skb_put_data(skb, page_address(page), 1);
                }
 
                skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
index ac02c54520e9733096ec984f3efe98b909182bfd..a7330eb3ec64e2120e31413c48e6a24c1d8d6a70 100644 (file)
@@ -554,7 +554,7 @@ _alloc_mISDN_skb(u_int prim, u_int id, u_int len, void *dp, gfp_t gfp_mask)
        if (!skb)
                return NULL;
        if (len)
-               memcpy(skb_put(skb, len), dp, len);
+               skb_put_data(skb, dp, len);
        hh = mISDN_HEAD_P(skb);
        hh->prim = prim;
        hh->id = id;
index 01ea64d0783ae1b8420966415981197ac8b18edf..5af5385a0e727bc184e448007c71c5aba0ef4728 100644 (file)
@@ -1913,6 +1913,16 @@ static inline void *skb_put_zero(struct sk_buff *skb, unsigned int len)
        return tmp;
 }
 
+static inline void *skb_put_data(struct sk_buff *skb, const void *data,
+                                unsigned int len)
+{
+       void *tmp = skb_put(skb, len);
+
+       memcpy(tmp, data, len);
+
+       return tmp;
+}
+
 unsigned char *skb_push(struct sk_buff *skb, unsigned int len);
 static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
 {
index d09d9746fc5d9843e2634b2632ddae0c4728c95a..ab15a6c095d3d30c1cf2840f56259ee488e9a724 100644 (file)
@@ -616,7 +616,7 @@ int nla_append(struct sk_buff *skb, int attrlen, const void *data)
        if (unlikely(skb_tailroom(skb) < NLA_ALIGN(attrlen)))
                return -EMSGSIZE;
 
-       memcpy(skb_put(skb, attrlen), data, attrlen);
+       skb_put_data(skb, data, attrlen);
        return 0;
 }
 EXPORT_SYMBOL(nla_append);
index fa8d6b475c063b2ce39cfba4ed7c762aeb30c3e4..a3501173e200d8713bb43d48e8e9a6bb2576835b 100644 (file)
@@ -732,8 +732,8 @@ static void batadv_iv_ogm_aggregate(struct batadv_forw_packet *forw_packet_aggr,
        unsigned char *skb_buff;
        unsigned long new_direct_link_flag;
 
-       skb_buff = skb_put(forw_packet_aggr->skb, packet_len);
-       memcpy(skb_buff, packet_buff, packet_len);
+       skb_buff = skb_put_data(forw_packet_aggr->skb, packet_buff,
+                               packet_len);
        forw_packet_aggr->packet_len += packet_len;
        forw_packet_aggr->num_packets++;
 
index 03a35c9f456d7aba00f768de483540d2cabb50e6..1e3dc374bfde960bde0731ad1acc26fc2cbe482d 100644 (file)
@@ -166,8 +166,7 @@ static void batadv_v_ogm_send(struct work_struct *work)
                goto reschedule;
 
        skb_reserve(skb, ETH_HLEN);
-       pkt_buff = skb_put(skb, ogm_buff_len);
-       memcpy(pkt_buff, ogm_buff, ogm_buff_len);
+       pkt_buff = skb_put_data(skb, ogm_buff, ogm_buff_len);
 
        ogm_packet = (struct batadv_ogm2_packet *)skb->data;
        ogm_packet->seqno = htonl(atomic_read(&bat_priv->bat_v.ogm_seqno));
@@ -382,8 +381,7 @@ static void batadv_v_ogm_forward(struct batadv_priv *bat_priv,
                goto out;
 
        skb_reserve(skb, ETH_HLEN);
-       skb_buff = skb_put(skb, packet_len);
-       memcpy(skb_buff, ogm_received, packet_len);
+       skb_buff = skb_put_data(skb, ogm_received, packet_len);
 
        /* apply forward penalty */
        ogm_forward = (struct batadv_ogm2_packet *)skb_buff;
index 8f964beaac284905c487ecfc5babaf2dd72d822c..a98cf1104a30a30e66fb6018bef59dea83dc4b7a 100644 (file)
@@ -296,8 +296,7 @@ batadv_frag_merge_packets(struct hlist_head *chain)
        /* Copy the payload of the each fragment into the last skb */
        hlist_for_each_entry(entry, chain, list) {
                size = entry->skb->len - hdr_size;
-               memcpy(skb_put(skb_out, size), entry->skb->data + hdr_size,
-                      size);
+               skb_put_data(skb_out, entry->skb->data + hdr_size, size);
        }
 
 free:
index 9e59b66541264a56a5a6a30651351b608bf1a8e8..f4c64ef01c24b8c24a44c0c3fde579f0cc5e8904 100644 (file)
@@ -122,7 +122,7 @@ static inline void cmtp_add_msgpart(struct cmtp_session *session, int id, const
        if (skb && (skb->len > 0))
                skb_copy_from_linear_data(skb, skb_put(nskb, skb->len), skb->len);
 
-       memcpy(skb_put(nskb, count), buf, count);
+       skb_put_data(nskb, buf, count);
 
        session->reassembly[id] = nskb;
 
index 93806b959039c7185ad29123c3ba0ad281d04be7..d860e3cc23cf151583e5d455edce572328e2168f 100644 (file)
@@ -3266,7 +3266,7 @@ int hci_reset_dev(struct hci_dev *hdev)
                return -ENOMEM;
 
        hci_skb_pkt_type(skb) = HCI_EVENT_PKT;
-       memcpy(skb_put(skb, 3), hw_err, 3);
+       skb_put_data(skb, hw_err, 3);
 
        /* Send Hardware Error to upper stack */
        return hci_recv_frame(hdev, skb);
index b5faff458d8beacaa1806c187d7d8703392bfea4..4e4105a932bd13c80f1659cb1901e976a0ae886b 100644 (file)
@@ -304,7 +304,7 @@ struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode, u32 plen,
        hdr->plen   = plen;
 
        if (plen)
-               memcpy(skb_put(skb, plen), param, plen);
+               skb_put_data(skb, param, plen);
 
        BT_DBG("skb len %d", skb->len);
 
index 638bf0e1a2e390133fc7bcfa2041fc41a94d413f..083e87f26a0f67359329ecba40346cfe5e3d01cb 100644 (file)
@@ -379,7 +379,7 @@ void hci_send_monitor_ctrl_event(struct hci_dev *hdev, u16 event,
                put_unaligned_le16(event, skb_put(skb, 2));
 
                if (data)
-                       memcpy(skb_put(skb, data_len), data, data_len);
+                       skb_put_data(skb, data, data_len);
 
                skb->tstamp = tstamp;
 
@@ -515,10 +515,10 @@ static struct sk_buff *create_monitor_ctrl_open(struct sock *sk)
 
        put_unaligned_le32(hci_pi(sk)->cookie, skb_put(skb, 4));
        put_unaligned_le16(format, skb_put(skb, 2));
-       memcpy(skb_put(skb, sizeof(ver)), ver, sizeof(ver));
+       skb_put_data(skb, ver, sizeof(ver));
        put_unaligned_le32(flags, skb_put(skb, 4));
        *skb_put(skb, 1) = TASK_COMM_LEN;
-       memcpy(skb_put(skb, TASK_COMM_LEN), hci_pi(sk)->comm, TASK_COMM_LEN);
+       skb_put_data(skb, hci_pi(sk)->comm, TASK_COMM_LEN);
 
        __net_timestamp(skb);
 
@@ -586,7 +586,7 @@ static struct sk_buff *create_monitor_ctrl_command(struct sock *sk, u16 index,
        put_unaligned_le16(opcode, skb_put(skb, 2));
 
        if (buf)
-               memcpy(skb_put(skb, len), buf, len);
+               skb_put_data(skb, buf, len);
 
        __net_timestamp(skb);
 
index 0bec4588c3c8c3db45a564c81394c464a7faaf4a..9e83713262e8f66f252827734ad5433368af2be3 100644 (file)
@@ -114,7 +114,7 @@ static int hidp_send_message(struct hidp_session *session, struct socket *sock,
 
        *skb_put(skb, 1) = hdr;
        if (data && size > 0)
-               memcpy(skb_put(skb, size), data, size);
+               skb_put_data(skb, data, size);
 
        skb_queue_tail(transmit, skb);
        wake_up_interruptible(sk_sleep(sk));
index f88ac99528ce448d8e0f8ea5eb06ee2d7719afab..fe6a5529bdf50b47eb0f6b8f48f05b73f2f3585d 100644 (file)
@@ -2923,7 +2923,7 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, u8 code,
 
        if (dlen) {
                count -= L2CAP_HDR_SIZE + L2CAP_CMD_HDR_SIZE;
-               memcpy(skb_put(skb, count), data, count);
+               skb_put_data(skb, data, count);
                data += count;
        }
 
@@ -2938,7 +2938,7 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, u8 code,
                if (!*frag)
                        goto fail;
 
-               memcpy(skb_put(*frag, count), data, count);
+               skb_put_data(*frag, data, count);
 
                len  -= count;
                data += count;
index c933bd08c1fed288d667d1c386fa936ed2d23102..11d0ca64402b5fb0f5c570173367432e7716d5c8 100644 (file)
@@ -44,7 +44,7 @@ static struct sk_buff *create_monitor_ctrl_event(__le16 index, u32 cookie,
        put_unaligned_le16(opcode, skb_put(skb, 2));
 
        if (buf)
-               memcpy(skb_put(skb, len), buf, len);
+               skb_put_data(skb, buf, len);
 
        __net_timestamp(skb);
 
@@ -75,7 +75,7 @@ int mgmt_send_event(u16 event, struct hci_dev *hdev, unsigned short channel,
        hdr->len = cpu_to_le16(data_len);
 
        if (data)
-               memcpy(skb_put(skb, data_len), data, data_len);
+               skb_put_data(skb, data, data_len);
 
        /* Time stamp */
        __net_timestamp(skb);
index 2f2cb5e27cdd4dc9b6079b5d602c89e510bd9ab8..5f3074cb6b4db67aad4491e99e291f073e1876c5 100644 (file)
@@ -798,7 +798,7 @@ static int rfcomm_tty_write(struct tty_struct *tty, const unsigned char *buf, in
 
                skb_reserve(skb, RFCOMM_SKB_HEAD_RESERVE);
 
-               memcpy(skb_put(skb, size), buf + sent, size);
+               skb_put_data(skb, buf + sent, size);
 
                rfcomm_dlc_send_noerror(dlc, skb);
 
index bb6ed8e975801e75d7818dc98e2f4a5b7127669e..15bf0c5322ab17dc3b220893fa1f1da7b1c39bd5 100644 (file)
@@ -151,8 +151,7 @@ static void nft_reject_br_send_v4_unreach(struct net *net,
        icmph->type     = ICMP_DEST_UNREACH;
        icmph->code     = code;
 
-       payload = skb_put(nskb, len);
-       memcpy(payload, skb_network_header(oldskb), len);
+       payload = skb_put_data(nskb, skb_network_header(oldskb), len);
 
        csum = csum_partial((void *)icmph, len + sizeof(struct icmphdr), 0);
        icmph->checksum = csum_fold(csum);
@@ -278,8 +277,7 @@ static void nft_reject_br_send_v6_unreach(struct net *net,
        icmp6h->icmp6_type = ICMPV6_DEST_UNREACH;
        icmp6h->icmp6_code = code;
 
-       payload = skb_put(nskb, len);
-       memcpy(payload, skb_network_header(oldskb), len);
+       payload = skb_put_data(nskb, skb_network_header(oldskb), len);
        nip6h->payload_len = htons(nskb->len - sizeof(struct ipv6hdr));
 
        icmp6h->icmp6_cksum =
index 65432633a25000361c720058f8c3e8499fff9529..47a8748d953afbf460238804d3d7d3d8b087f474 100644 (file)
@@ -282,7 +282,7 @@ static void bcm_can_tx(struct bcm_op *op)
        can_skb_prv(skb)->ifindex = dev->ifindex;
        can_skb_prv(skb)->skbcnt = 0;
 
-       memcpy(skb_put(skb, op->cfsiz), cf, op->cfsiz);
+       skb_put_data(skb, cf, op->cfsiz);
 
        /* send with loopback */
        skb->dev = dev;
@@ -318,13 +318,13 @@ static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head,
        if (!skb)
                return;
 
-       memcpy(skb_put(skb, sizeof(*head)), head, sizeof(*head));
+       skb_put_data(skb, head, sizeof(*head));
 
        if (head->nframes) {
                /* CAN frames starting here */
                firstframe = (struct canfd_frame *)skb_tail_pointer(skb);
 
-               memcpy(skb_put(skb, datalen), frames, datalen);
+               skb_put_data(skb, frames, datalen);
 
                /*
                 * the BCM uses the flags-element of the canfd_frame
index 849805e7af523a0f1159c5e3b6914a4ccd99b353..b8a5587153956226a141e2f1ccf4367859e67875 100644 (file)
@@ -533,7 +533,7 @@ void dn_send_conn_conf(struct sock *sk, gfp_t gfp)
        *skb_put(skb,1) = len;
 
        if (len > 0)
-               memcpy(skb_put(skb, len), scp->conndata_out.opt_data, len);
+               skb_put_data(skb, scp->conndata_out.opt_data, len);
 
 
        dn_nsp_send(skb);
@@ -691,22 +691,22 @@ void dn_nsp_send_conninit(struct sock *sk, unsigned char msgflg)
        aux = scp->accessdata.acc_userl;
        *skb_put(skb, 1) = aux;
        if (aux > 0)
-               memcpy(skb_put(skb, aux), scp->accessdata.acc_user, aux);
+               skb_put_data(skb, scp->accessdata.acc_user, aux);
 
        aux = scp->accessdata.acc_passl;
        *skb_put(skb, 1) = aux;
        if (aux > 0)
-               memcpy(skb_put(skb, aux), scp->accessdata.acc_pass, aux);
+               skb_put_data(skb, scp->accessdata.acc_pass, aux);
 
        aux = scp->accessdata.acc_accl;
        *skb_put(skb, 1) = aux;
        if (aux > 0)
-               memcpy(skb_put(skb, aux), scp->accessdata.acc_acc, aux);
+               skb_put_data(skb, scp->accessdata.acc_acc, aux);
 
        aux = (__u8)le16_to_cpu(scp->conndata_out.opt_optl);
        *skb_put(skb, 1) = aux;
        if (aux > 0)
-               memcpy(skb_put(skb, aux), scp->conndata_out.opt_data, aux);
+               skb_put_data(skb, scp->conndata_out.opt_data, aux);
 
        scp->persist = dn_nsp_persist(sk);
        scp->persist_fxn = dn_nsp_retrans_conninit;
index dbb476d7d38f1ddc1d1ed8769176338461657fa5..e6ff5128e61acf135b7be9071dc06ed2e4fa96b7 100644 (file)
@@ -121,8 +121,7 @@ lowpan_alloc_frag(struct sk_buff *skb, int size,
                *mac_cb(frag) = *mac_cb(skb);
 
                if (frag1) {
-                       memcpy(skb_put(frag, skb->mac_len),
-                              skb_mac_header(skb), skb->mac_len);
+                       skb_put_data(frag, skb_mac_header(skb), skb->mac_len);
                } else {
                        rc = wpan_dev_hard_header(frag, wdev,
                                                  &master_hdr->dest,
@@ -152,8 +151,8 @@ lowpan_xmit_fragment(struct sk_buff *skb, const struct ieee802154_hdr *wpan_hdr,
        if (IS_ERR(frag))
                return PTR_ERR(frag);
 
-       memcpy(skb_put(frag, frag_hdrlen), frag_hdr, frag_hdrlen);
-       memcpy(skb_put(frag, len), skb_network_header(skb) + offset, len);
+       skb_put_data(frag, frag_hdr, frag_hdrlen);
+       skb_put_data(frag, skb_network_header(skb) + offset, len);
 
        raw_dump_table(__func__, " fragment dump", frag->data, frag->len);
 
index 9098429e38bcc95e47829a7fa1c2534c42e3e4ae..b64046ccae69c6fdf46646abdc51e2063c6a2d69 100644 (file)
@@ -1602,7 +1602,7 @@ static struct sk_buff *mld_newpack(struct inet6_dev *idev, unsigned int mtu)
 
        ip6_mc_hdr(sk, skb, dev, saddr, &mld2_all_mcr, NEXTHDR_HOP, 0);
 
-       memcpy(skb_put(skb, sizeof(ra)), ra, sizeof(ra));
+       skb_put_data(skb, ra, sizeof(ra));
 
        skb_set_transport_header(skb, skb_tail_pointer(skb) - skb->data);
        skb_put(skb, sizeof(*pmr));
@@ -2006,7 +2006,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
 
        ip6_mc_hdr(sk, skb, dev, saddr, snd_addr, NEXTHDR_HOP, payload_len);
 
-       memcpy(skb_put(skb, sizeof(ra)), ra, sizeof(ra));
+       skb_put_data(skb, ra, sizeof(ra));
 
        hdr = skb_put_zero(skb, sizeof(struct mld_msg));
        hdr->mld_type = type;
index f6061c4bb0a8056013141926ff114da710b8fa8c..ec157c3419b5165f7b2a51dd7b763ad2a413bc57 100644 (file)
@@ -690,7 +690,7 @@ static int ircomm_tty_write(struct tty_struct *tty,
                }
 
                /* Copy data */
-               memcpy(skb_put(skb,size), buf + len, size);
+               skb_put_data(skb, buf + len, size);
 
                count -= size;
                len += size;
index b936b1251a66d11c4a1bdde2405f8303e3576c5d..bf56ac7dba96abbfb906f0b27d407b812a2e283b 100644 (file)
@@ -392,8 +392,7 @@ void irlap_send_discovery_xid_frame(struct irlap_cb *self, int S, __u8 s,
                info[0] = discovery->data.charset;
 
                len = IRDA_MIN(discovery->name_len, skb_tailroom(tx_skb));
-               info = skb_put(tx_skb, len);
-               memcpy(info, discovery->data.info, len);
+               info = skb_put_data(tx_skb, discovery->data.info, len);
        }
        irlap_queue_xmit(self, tx_skb);
 }
@@ -1216,8 +1215,7 @@ void irlap_send_test_frame(struct irlap_cb *self, __u8 caddr, __u32 daddr,
        frame->control = TEST_RSP | PF_BIT;
 
        /* Copy info */
-       info = skb_put(tx_skb, cmd->len);
-       memcpy(info, cmd->data, cmd->len);
+       info = skb_put_data(tx_skb, cmd->data, cmd->len);
 
        /* Return to sender */
        irlap_wait_min_turn_around(self, &self->qos_tx);
index 8ad430edb5b87882df5f25c3392a7aedb7eca841..3ebb4268973b0dc9ffc1c2eade9834ccb0961245 100644 (file)
@@ -1706,8 +1706,7 @@ static int unicast_flush_resp(struct sock *sk, const struct sadb_msg *ihdr)
        if (!skb)
                return -ENOBUFS;
 
-       hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg));
-       memcpy(hdr, ihdr, sizeof(struct sadb_msg));
+       hdr = skb_put_data(skb, ihdr, sizeof(struct sadb_msg));
        hdr->sadb_msg_errno = (uint8_t) 0;
        hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
 
index 660ac6a426f43218bd9b35cc2fbea9751b4e5915..e9c6aa3ed05b8ddb8cf03decce82c00e59b4c0a7 100644 (file)
@@ -1569,7 +1569,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
                return;
 
        skb_reserve(skb, local->tx_headroom);
-       memcpy(skb_put(skb, presp->head_len), presp->head, presp->head_len);
+       skb_put_data(skb, presp->head, presp->head_len);
 
        memcpy(((struct ieee80211_mgmt *) skb->data)->da, mgmt->sa, ETH_ALEN);
        ibss_dbg(sdata, "Sending ProbeResp to %pM\n", mgmt->sa);
index e45c8d94952eaa6e7a7d5a532352a4416193ba70..861697f2d75b1d32be4dff0fc4607c447870bd4e 100644 (file)
@@ -345,7 +345,7 @@ int mesh_add_vendor_ies(struct ieee80211_sub_if_data *sdata,
                data = ifmsh->ie + offset;
                if (skb_tailroom(skb) < len)
                        return -ENOMEM;
-               memcpy(skb_put(skb, len), data, len);
+               skb_put_data(skb, data, len);
        }
 
        return 0;
@@ -369,7 +369,7 @@ int mesh_add_rsn_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
 
        if (skb_tailroom(skb) < len)
                return -ENOMEM;
-       memcpy(skb_put(skb, len), data, len);
+       skb_put_data(skb, data, len);
 
        return 0;
 }
@@ -1125,8 +1125,8 @@ ieee80211_mesh_rx_probe_req(struct ieee80211_sub_if_data *sdata,
                goto out;
 
        skb_reserve(presp, local->tx_headroom);
-       memcpy(skb_put(presp, bcn->head_len), bcn->head, bcn->head_len);
-       memcpy(skb_put(presp, bcn->tail_len), bcn->tail, bcn->tail_len);
+       skb_put_data(presp, bcn->head, bcn->head_len);
+       skb_put_data(presp, bcn->tail, bcn->tail_len);
        hdr = (struct ieee80211_mgmt *) presp->data;
        hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
                                         IEEE80211_STYPE_PROBE_RESP);
index e810334595ff24785f81c98295c0522bc7ccbe2f..7be7917e154192cac641988a2eba25074d94560e 100644 (file)
@@ -796,8 +796,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
                                                 after_ric,
                                                 ARRAY_SIZE(after_ric),
                                                 offset);
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, assoc_data->ie + offset, noffset - offset);
+               pos = skb_put_data(skb, assoc_data->ie + offset,
+                                  noffset - offset);
                offset = noffset;
        }
 
@@ -834,8 +834,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
                noffset = ieee80211_ie_split(assoc_data->ie, assoc_data->ie_len,
                                             before_vht, ARRAY_SIZE(before_vht),
                                             offset);
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, assoc_data->ie + offset, noffset - offset);
+               pos = skb_put_data(skb, assoc_data->ie + offset,
+                                  noffset - offset);
                offset = noffset;
        }
 
@@ -848,8 +848,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
                noffset = ieee80211_ie_split_vendor(assoc_data->ie,
                                                    assoc_data->ie_len,
                                                    offset);
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, assoc_data->ie + offset, noffset - offset);
+               pos = skb_put_data(skb, assoc_data->ie + offset,
+                                  noffset - offset);
                offset = noffset;
        }
 
@@ -868,8 +868,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
        /* add any remaining custom (i.e. vendor specific here) IEs */
        if (assoc_data->ie_len) {
                noffset = assoc_data->ie_len;
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, assoc_data->ie + offset, noffset - offset);
+               pos = skb_put_data(skb, assoc_data->ie + offset,
+                                  noffset - offset);
        }
 
        if (assoc_data->fils_kek_len &&
index eede5c6db8d5a784a27da0c53fc6f34b75dcf0bb..f8e7a8bbc618727bada48c27d59bc01ed5a18498 100644 (file)
@@ -885,8 +885,7 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
        }
        skb_reserve(skb, local->hw.extra_tx_headroom);
 
-       data = skb_put(skb, params->len);
-       memcpy(data, params->buf, params->len);
+       data = skb_put_data(skb, params->buf, params->len);
 
        /* Update CSA counters */
        if (sdata->vif.csa_active &&
index e1ab1c4af33ceacd98bf8e593ac846c3dc35bd08..53b00bb520956dbf873d1ff511643ac5a86c7318 100644 (file)
@@ -2098,7 +2098,7 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
                }
        }
        while ((skb = __skb_dequeue(&entry->skb_list))) {
-               memcpy(skb_put(rx->skb, skb->len), skb->data, skb->len);
+               skb_put_data(rx->skb, skb->data, skb->len);
                dev_kfree_skb(skb);
        }
 
index c379c99cd1d835c1978bddfa8ba7a464455c8701..86740670102d99e448b437c9e31e6808152b9503 100644 (file)
@@ -388,8 +388,7 @@ ieee80211_tdls_add_setup_start_ies(struct ieee80211_sub_if_data *sdata,
                                             before_ext_cap,
                                             ARRAY_SIZE(before_ext_cap),
                                             offset);
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, extra_ies + offset, noffset - offset);
+               pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
                offset = noffset;
        }
 
@@ -418,8 +417,7 @@ ieee80211_tdls_add_setup_start_ies(struct ieee80211_sub_if_data *sdata,
                                             before_ht_cap,
                                             ARRAY_SIZE(before_ht_cap),
                                             offset);
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, extra_ies + offset, noffset - offset);
+               pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
                offset = noffset;
        }
 
@@ -490,8 +488,7 @@ ieee80211_tdls_add_setup_start_ies(struct ieee80211_sub_if_data *sdata,
                                             before_vht_cap,
                                             ARRAY_SIZE(before_vht_cap),
                                             offset);
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, extra_ies + offset, noffset - offset);
+               pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
                offset = noffset;
        }
 
@@ -532,8 +529,7 @@ ieee80211_tdls_add_setup_start_ies(struct ieee80211_sub_if_data *sdata,
        /* add any remaining IEs */
        if (extra_ies_len) {
                noffset = extra_ies_len;
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, extra_ies + offset, noffset - offset);
+               pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
        }
 
 }
@@ -575,8 +571,7 @@ ieee80211_tdls_add_setup_cfm_ies(struct ieee80211_sub_if_data *sdata,
                                             before_qos,
                                             ARRAY_SIZE(before_qos),
                                             offset);
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, extra_ies + offset, noffset - offset);
+               pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
                offset = noffset;
        }
 
@@ -596,8 +591,7 @@ ieee80211_tdls_add_setup_cfm_ies(struct ieee80211_sub_if_data *sdata,
                                             before_ht_op,
                                             ARRAY_SIZE(before_ht_op),
                                             offset);
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, extra_ies + offset, noffset - offset);
+               pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
                offset = noffset;
        }
 
@@ -638,8 +632,7 @@ ieee80211_tdls_add_setup_cfm_ies(struct ieee80211_sub_if_data *sdata,
        /* add any remaining IEs */
        if (extra_ies_len) {
                noffset = extra_ies_len;
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, extra_ies + offset, noffset - offset);
+               pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
        }
 }
 
@@ -670,8 +663,7 @@ ieee80211_tdls_add_chan_switch_req_ies(struct ieee80211_sub_if_data *sdata,
                                             before_lnkie,
                                             ARRAY_SIZE(before_lnkie),
                                             offset);
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, extra_ies + offset, noffset - offset);
+               pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
                offset = noffset;
        }
 
@@ -680,8 +672,7 @@ ieee80211_tdls_add_chan_switch_req_ies(struct ieee80211_sub_if_data *sdata,
        /* add any remaining IEs */
        if (extra_ies_len) {
                noffset = extra_ies_len;
-               pos = skb_put(skb, noffset - offset);
-               memcpy(pos, extra_ies + offset, noffset - offset);
+               pos = skb_put_data(skb, extra_ies + offset, noffset - offset);
        }
 }
 
@@ -696,7 +687,7 @@ ieee80211_tdls_add_chan_switch_resp_ies(struct ieee80211_sub_if_data *sdata,
                ieee80211_tdls_add_link_ie(sdata, skb, peer, initiator);
 
        if (extra_ies_len)
-               memcpy(skb_put(skb, extra_ies_len), extra_ies, extra_ies_len);
+               skb_put_data(skb, extra_ies, extra_ies_len);
 }
 
 static void ieee80211_tdls_add_ies(struct ieee80211_sub_if_data *sdata,
@@ -726,8 +717,7 @@ static void ieee80211_tdls_add_ies(struct ieee80211_sub_if_data *sdata,
        case WLAN_TDLS_TEARDOWN:
        case WLAN_TDLS_DISCOVERY_REQUEST:
                if (extra_ies_len)
-                       memcpy(skb_put(skb, extra_ies_len), extra_ies,
-                              extra_ies_len);
+                       skb_put_data(skb, extra_ies, extra_ies_len);
                if (status_code == 0 || action_code == WLAN_TDLS_TEARDOWN)
                        ieee80211_tdls_add_link_ie(sdata, skb, peer, initiator);
                break;
index 1af9ed29a915bb29100fcc9b5f6ea984db3c5cc0..18c5d6e6305ddd104c5fe55e5287f63c6f8d114b 100644 (file)
@@ -903,8 +903,8 @@ static int ieee80211_fragment(struct ieee80211_tx_data *tx,
                tmp->dev = skb->dev;
 
                /* copy header and data */
-               memcpy(skb_put(tmp, hdrlen), skb->data, hdrlen);
-               memcpy(skb_put(tmp, fraglen), skb->data + pos, fraglen);
+               skb_put_data(tmp, skb->data, hdrlen);
+               skb_put_data(tmp, skb->data + pos, fraglen);
 
                pos += fraglen;
        }
@@ -4132,8 +4132,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw,
                                goto out;
 
                        skb_reserve(skb, local->tx_headroom);
-                       memcpy(skb_put(skb, beacon->head_len), beacon->head,
-                              beacon->head_len);
+                       skb_put_data(skb, beacon->head, beacon->head_len);
 
                        ieee80211_beacon_add_tim(sdata, &ap->ps, skb,
                                                 is_template);
@@ -4147,8 +4146,8 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw,
                        }
 
                        if (beacon->tail)
-                               memcpy(skb_put(skb, beacon->tail_len),
-                                      beacon->tail, beacon->tail_len);
+                               skb_put_data(skb, beacon->tail,
+                                            beacon->tail_len);
                } else
                        goto out;
        } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
@@ -4171,8 +4170,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw,
                if (!skb)
                        goto out;
                skb_reserve(skb, local->tx_headroom);
-               memcpy(skb_put(skb, beacon->head_len), beacon->head,
-                      beacon->head_len);
+               skb_put_data(skb, beacon->head, beacon->head_len);
 
                hdr = (struct ieee80211_hdr *) skb->data;
                hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
@@ -4207,8 +4205,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw,
                if (!skb)
                        goto out;
                skb_reserve(skb, local->tx_headroom);
-               memcpy(skb_put(skb, beacon->head_len), beacon->head,
-                      beacon->head_len);
+               skb_put_data(skb, beacon->head, beacon->head_len);
                ieee80211_beacon_add_tim(sdata, &ifmsh->ps, skb, is_template);
 
                if (offs) {
@@ -4216,8 +4213,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw,
                        offs->tim_length = skb->len - beacon->head_len;
                }
 
-               memcpy(skb_put(skb, beacon->tail_len), beacon->tail,
-                      beacon->tail_len);
+               skb_put_data(skb, beacon->tail, beacon->tail_len);
        } else {
                WARN_ON(1);
                goto out;
@@ -4337,7 +4333,7 @@ struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw,
        if (!skb)
                goto out;
 
-       memcpy(skb_put(skb, presp->len), presp->data, presp->len);
+       skb_put_data(skb, presp->data, presp->len);
 
        hdr = (struct ieee80211_hdr *) skb->data;
        memset(hdr->addr1, 0, sizeof(hdr->addr1));
index 148c7276869cb0c7e26bd3812c60752e71406e77..259698de569ffa6a93c2738f85d6fd6af142eb9a 100644 (file)
@@ -1252,7 +1252,7 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
        mgmt->u.auth.auth_transaction = cpu_to_le16(transaction);
        mgmt->u.auth.status_code = cpu_to_le16(status);
        if (extra)
-               memcpy(skb_put(skb, extra_len), extra, extra_len);
+               skb_put_data(skb, extra, extra_len);
 
        if (auth_alg == WLAN_AUTH_SHARED_KEY && transaction == 3) {
                mgmt->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
@@ -1292,8 +1292,7 @@ void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
                skb_reserve(skb, local->hw.extra_tx_headroom);
 
                /* copy in frame */
-               memcpy(skb_put(skb, IEEE80211_DEAUTH_FRAME_LEN),
-                      mgmt, IEEE80211_DEAUTH_FRAME_LEN);
+               skb_put_data(skb, mgmt, IEEE80211_DEAUTH_FRAME_LEN);
 
                if (sdata->vif.type != NL80211_IFTYPE_STATION ||
                    !(sdata->u.mgd.flags & IEEE80211_STA_MFP_ENABLED))
index 7586d446d7dcafc5c44b43190398840b68107d1f..bd24a975fd49987ead6aebcc44f3a02c81ba5397 100644 (file)
@@ -170,7 +170,7 @@ static struct sk_buff *netlink_to_full_skb(const struct sk_buff *skb,
        NETLINK_CB(new).dst_group = NETLINK_CB(skb).dst_group;
        NETLINK_CB(new).creds = NETLINK_CB(skb).creds;
 
-       memcpy(skb_put(new, len), skb->data, len);
+       skb_put_data(new, skb->data, len);
        return new;
 }
 
index f864ce19e13dbc5d7734ca2ff8308047089c2d70..f44f75a2a4d566eecd83ef776897aee92c5cf4f8 100644 (file)
@@ -226,8 +226,7 @@ digital_send_dep_data_prep(struct nfc_digital_dev *ddev, struct sk_buff *skb,
                        return ERR_PTR(-ENOMEM);
                }
 
-               memcpy(skb_put(new_skb, ddev->remote_payload_max), skb->data,
-                      ddev->remote_payload_max);
+               skb_put_data(new_skb, skb->data, ddev->remote_payload_max);
                skb_pull(skb, ddev->remote_payload_max);
 
                ddev->chaining_skb = skb;
@@ -277,8 +276,7 @@ digital_recv_dep_data_gather(struct nfc_digital_dev *ddev, u8 pfb,
                        ddev->chaining_skb = new_skb;
                }
 
-               memcpy(skb_put(ddev->chaining_skb, resp->len), resp->data,
-                      resp->len);
+               skb_put_data(ddev->chaining_skb, resp->data, resp->len);
 
                kfree_skb(resp);
                resp = NULL;
@@ -525,7 +523,7 @@ int digital_in_send_atr_req(struct nfc_digital_dev *ddev,
 
        if (gb_len) {
                atr_req->pp |= DIGITAL_GB_BIT;
-               memcpy(skb_put(skb, gb_len), gb, gb_len);
+               skb_put_data(skb, gb, gb_len);
        }
 
        digital_skb_push_dep_sod(ddev, skb);
@@ -1012,8 +1010,7 @@ static int digital_tg_send_ack(struct nfc_digital_dev *ddev,
        if (ddev->did) {
                dep_res->pfb |= DIGITAL_NFC_DEP_PFB_DID_BIT;
 
-               memcpy(skb_put(skb, sizeof(ddev->did)), &ddev->did,
-                      sizeof(ddev->did));
+               skb_put_data(skb, &ddev->did, sizeof(ddev->did));
        }
 
        ddev->curr_nfc_dep_pni =
@@ -1057,8 +1054,7 @@ static int digital_tg_send_atn(struct nfc_digital_dev *ddev)
        if (ddev->did) {
                dep_res->pfb |= DIGITAL_NFC_DEP_PFB_DID_BIT;
 
-               memcpy(skb_put(skb, sizeof(ddev->did)), &ddev->did,
-                      sizeof(ddev->did));
+               skb_put_data(skb, &ddev->did, sizeof(ddev->did));
        }
 
        digital_skb_push_dep_sod(ddev, skb);
@@ -1325,8 +1321,7 @@ int digital_tg_send_dep_res(struct nfc_digital_dev *ddev, struct sk_buff *skb)
        if (ddev->did) {
                dep_res->pfb |= DIGITAL_NFC_DEP_PFB_DID_BIT;
 
-               memcpy(skb_put(skb, sizeof(ddev->did)), &ddev->did,
-                      sizeof(ddev->did));
+               skb_put_data(skb, &ddev->did, sizeof(ddev->did));
        }
 
        ddev->curr_nfc_dep_pni =
index 2b0f0ac498d2c02c92a62d8e749a103f5b1849c1..8741ad47a6fbd30e78b3745552504b2344f38e31 100644 (file)
@@ -878,9 +878,9 @@ static void nfc_hci_recv_from_llc(struct nfc_hci_dev *hdev, struct sk_buff *skb)
 
                skb_queue_walk(&hdev->rx_hcp_frags, frag_skb) {
                        msg_len = frag_skb->len - NFC_HCI_HCP_PACKET_HEADER_LEN;
-                       memcpy(skb_put(hcp_skb, msg_len),
-                              frag_skb->data + NFC_HCI_HCP_PACKET_HEADER_LEN,
-                              msg_len);
+                       skb_put_data(hcp_skb,
+                                    frag_skb->data + NFC_HCI_HCP_PACKET_HEADER_LEN,
+                                    msg_len);
                }
 
                skb_queue_purge(&hdev->rx_hcp_frags);
index c5959ce503e6c857c98d5cb7583f48b42b3eac71..367d8c02710181f06bf1a422e41239ed12e77d90 100644 (file)
@@ -298,7 +298,7 @@ static struct sk_buff *llcp_add_header(struct sk_buff *pdu,
 
        pr_debug("header 0x%x 0x%x\n", header[0], header[1]);
 
-       memcpy(skb_put(pdu, LLCP_HEADER_SIZE), header, LLCP_HEADER_SIZE);
+       skb_put_data(pdu, header, LLCP_HEADER_SIZE);
 
        return pdu;
 }
@@ -311,7 +311,7 @@ static struct sk_buff *llcp_add_tlv(struct sk_buff *pdu, u8 *tlv,
        if (tlv == NULL)
                return NULL;
 
-       memcpy(skb_put(pdu, tlv_length), tlv, tlv_length);
+       skb_put_data(pdu, tlv, tlv_length);
 
        return pdu;
 }
@@ -549,7 +549,7 @@ int nfc_llcp_send_snl_sdres(struct nfc_llcp_local *local,
                return PTR_ERR(skb);
 
        hlist_for_each_entry_safe(sdp, n, tlv_list, node) {
-               memcpy(skb_put(skb, sdp->tlv_len), sdp->tlv, sdp->tlv_len);
+               skb_put_data(skb, sdp->tlv, sdp->tlv_len);
 
                hlist_del(&sdp->node);
 
@@ -581,8 +581,7 @@ int nfc_llcp_send_snl_sdreq(struct nfc_llcp_local *local,
        hlist_for_each_entry_safe(sdreq, n, tlv_list, node) {
                pr_debug("tid %d for %s\n", sdreq->tid, sdreq->uri);
 
-               memcpy(skb_put(skb, sdreq->tlv_len), sdreq->tlv,
-                      sdreq->tlv_len);
+               skb_put_data(skb, sdreq->tlv, sdreq->tlv_len);
 
                hlist_del(&sdreq->node);
 
@@ -622,7 +621,7 @@ int nfc_llcp_send_dm(struct nfc_llcp_local *local, u8 ssap, u8 dsap, u8 reason)
 
        skb = llcp_add_header(skb, dsap, ssap, LLCP_PDU_DM);
 
-       memcpy(skb_put(skb, 1), &reason, 1);
+       skb_put_data(skb, &reason, 1);
 
        skb_queue_head(&local->tx_queue, skb);
 
@@ -693,7 +692,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
                skb_put(pdu, LLCP_SEQUENCE_SIZE);
 
                if (likely(frag_len > 0))
-                       memcpy(skb_put(pdu, frag_len), msg_ptr, frag_len);
+                       skb_put_data(pdu, msg_ptr, frag_len);
 
                skb_queue_tail(&sock->tx_queue, pdu);
 
@@ -759,7 +758,7 @@ int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap,
                pdu = llcp_add_header(pdu, dsap, ssap, LLCP_PDU_UI);
 
                if (likely(frag_len > 0))
-                       memcpy(skb_put(pdu, frag_len), msg_ptr, frag_len);
+                       skb_put_data(pdu, msg_ptr, frag_len);
 
                /* No need to check for the peer RW for UI frames */
                skb_queue_tail(&local->tx_queue, pdu);
index e69786c6804cdf83cd5b758bad3985afacb1a4b2..02eef5cf3cce0a177bd0a302575004015933a25b 100644 (file)
@@ -1390,7 +1390,7 @@ static void nfc_llcp_recv_agf(struct nfc_llcp_local *local, struct sk_buff *skb)
                        return;
                }
 
-               memcpy(skb_put(new_skb, pdu_len), skb->data, pdu_len);
+               skb_put_data(new_skb, skb->data, pdu_len);
 
                nfc_llcp_rx_skb(local, new_skb);
 
index 61fff422424f7405e4f39f0d6ed01f32c8ffdbb1..17b9f1ce23db1727a781d4a5d21603ddda4ccf6a 100644 (file)
@@ -462,7 +462,7 @@ int nci_nfcc_loopback(struct nci_dev *ndev, void *data, size_t data_len,
                return -ENOMEM;
 
        skb_reserve(skb, NCI_DATA_HDR_SIZE);
-       memcpy(skb_put(skb, data_len), data, data_len);
+       skb_put_data(skb, data, data_len);
 
        loopback_data.conn_id = conn_id;
        loopback_data.data = skb;
@@ -1350,7 +1350,7 @@ int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload)
        nci_pbf_set((__u8 *)hdr, NCI_PBF_LAST);
 
        if (plen)
-               memcpy(skb_put(skb, plen), payload, plen);
+               skb_put_data(skb, payload, plen);
 
        skb_queue_tail(&ndev->cmd_q, skb);
        queue_work(ndev->cmd_wq, &ndev->cmd_work);
index dbd24254412a69d4c18c69a37d90608854a2ba9e..2488d9241f1d43c2bf3ea303f8d274243efc7588 100644 (file)
@@ -138,7 +138,7 @@ static int nci_queue_tx_data_frags(struct nci_dev *ndev,
                skb_reserve(skb_frag, NCI_DATA_HDR_SIZE);
 
                /* first, copy the data */
-               memcpy(skb_put(skb_frag, frag_len), data, frag_len);
+               skb_put_data(skb_frag, data, frag_len);
 
                /* second, set the header */
                nci_push_data_hdr(ndev, conn_id, skb_frag,
index a0ab26d535dca7492facc16f7aa11796732d685a..d4a53ce818c36fb8306add111b7c0098004bc48d 100644 (file)
@@ -187,7 +187,7 @@ static int nci_hci_send_data(struct nci_dev *ndev, u8 pipe,
                *skb_push(skb, 1) = cb;
 
                if (len > 0)
-                       memcpy(skb_put(skb, len), data + i, len);
+                       skb_put_data(skb, data + i, len);
 
                r = nci_send_data(ndev, conn_info->conn_id, skb);
                if (r < 0)
@@ -476,8 +476,9 @@ void nci_hci_data_received_cb(void *context,
 
                skb_queue_walk(&ndev->hci_dev->rx_hcp_frags, frag_skb) {
                        msg_len = frag_skb->len - NCI_HCI_HCP_PACKET_HEADER_LEN;
-                       memcpy(skb_put(hcp_skb, msg_len), frag_skb->data +
-                              NCI_HCI_HCP_PACKET_HEADER_LEN, msg_len);
+                       skb_put_data(hcp_skb,
+                                    frag_skb->data + NCI_HCI_HCP_PACKET_HEADER_LEN,
+                                    msg_len);
                }
 
                skb_queue_purge(&ndev->hci_dev->rx_hcp_frags);
index c468eabd69430b1687d0b68b086e4883afc74bf9..cfa7f352c1c3677ff0a6d809b7f563df42743a9f 100644 (file)
@@ -371,7 +371,7 @@ static int nci_uart_default_recv_buf(struct nci_uart *nu, const u8 *data,
                chunk_len = nu->rx_packet_len - nu->rx_skb->len;
                if (count < chunk_len)
                        chunk_len = count;
-               memcpy(skb_put(nu->rx_skb, chunk_len), data, chunk_len);
+               skb_put_data(nu->rx_skb, data, chunk_len);
                data += chunk_len;
                count -= chunk_len;
 
index 825f97671591e0c9c574f28d072b34ab4e911c01..cff679167bdcb336e802d2028bb6320fd2bd82f1 100644 (file)
@@ -239,7 +239,7 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len)
                return -ENOMEM;
 
        skb_reset_transport_header(skb);
-       memcpy(skb_put(skb, len), data, len);
+       skb_put_data(skb, data, len);
 
        skb_queue_tail(&node->rx_queue, skb);
        schedule_work(&node->work);
index c339c682675a6f643bacccd9e02d4ef18c43f1c1..febcc350cf00b7d7ad0716576551a6d34822b23e 100644 (file)
@@ -469,8 +469,7 @@ merge:
                                auth = (struct sctp_auth_chunk *)
                                                        skb_tail_pointer(nskb);
 
-                       memcpy(skb_put(nskb, chunk->skb->len), chunk->skb->data,
-                              chunk->skb->len);
+                       skb_put_data(nskb, chunk->skb->data, chunk->skb->len);
 
                        pr_debug("*** Chunk:%p[%s] %s 0x%x, length:%d, chunk->skb->len:%d, rtt_in_progress:%d\n",
                                 chunk,
index aaac2660aaf73078ec4d98403b833c406fa129e4..034e916362cf99495c722bc5f3d307d9fbd97464 100644 (file)
@@ -1479,9 +1479,7 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
        int padlen = SCTP_PAD4(chunklen) - chunklen;
 
        padding = skb_put_zero(chunk->skb, padlen);
-       target = skb_put(chunk->skb, len);
-
-       memcpy(target, data, len);
+       target = skb_put_data(chunk->skb, data, len);
 
        /* Adjust the chunk length field.  */
        chunk->chunk_hdr->length = htons(chunklen + padlen + len);
index 18e24793659f928221297208ff4c82c8e385d14b..24e2054bfbafd76bceeac2b4c3a3c19f48d3a8ad 100644 (file)
@@ -132,12 +132,10 @@ static struct sk_buff *virtio_transport_build_skb(void *opaque)
                break;
        }
 
-       t_hdr = skb_put(skb, sizeof(pkt->hdr));
-       memcpy(t_hdr, &pkt->hdr, sizeof(pkt->hdr));
+       t_hdr = skb_put_data(skb, &pkt->hdr, sizeof(pkt->hdr));
 
        if (pkt->len) {
-               payload = skb_put(skb, pkt->len);
-               memcpy(payload, pkt->buf, pkt->len);
+               payload = skb_put_data(skb, pkt->buf, pkt->len);
        }
 
        return skb;
index 6b5af65f491fb2e6112a0d0f1b510308e1b28c51..eb466ece1730998550ba65d3cf65fc8fdf363d59 100644 (file)
@@ -188,17 +188,14 @@ void x25_write_internal(struct sock *sk, int frametype)
                        *dptr++ = X25_CALL_REQUEST;
                        len     = x25_addr_aton(addresses, &x25->dest_addr,
                                                &x25->source_addr);
-                       dptr    = skb_put(skb, len);
-                       memcpy(dptr, addresses, len);
+                       dptr = skb_put_data(skb, addresses, len);
                        len     = x25_create_facilities(facilities,
                                        &x25->facilities,
                                        &x25->dte_facilities,
                                        x25->neighbour->global_facil_mask);
-                       dptr    = skb_put(skb, len);
-                       memcpy(dptr, facilities, len);
-                       dptr = skb_put(skb, x25->calluserdata.cudlength);
-                       memcpy(dptr, x25->calluserdata.cuddata,
-                              x25->calluserdata.cudlength);
+                       dptr = skb_put_data(skb, facilities, len);
+                       dptr = skb_put_data(skb, x25->calluserdata.cuddata,
+                                           x25->calluserdata.cudlength);
                        x25->calluserdata.cudlength = 0;
                        break;
 
@@ -210,17 +207,15 @@ void x25_write_internal(struct sock *sk, int frametype)
                                                        &x25->facilities,
                                                        &x25->dte_facilities,
                                                        x25->vc_facil_mask);
-                       dptr    = skb_put(skb, len);
-                       memcpy(dptr, facilities, len);
+                       dptr = skb_put_data(skb, facilities, len);
 
                        /* fast select with no restriction on response
                                allows call user data. Userland must
                                ensure it is ours and not theirs */
                        if(x25->facilities.reverse & 0x80) {
-                               dptr = skb_put(skb,
-                                       x25->calluserdata.cudlength);
-                               memcpy(dptr, x25->calluserdata.cuddata,
-                                      x25->calluserdata.cudlength);
+                               dptr = skb_put_data(skb,
+                                                   x25->calluserdata.cuddata,
+                                                   x25->calluserdata.cudlength);
                        }
                        x25->calluserdata.cudlength = 0;
                        break;