linux/drivers/staging/rtl8712
Johannes Berg 59ae1d127a networking: introduce and use skb_put_data()
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>
2017-06-16 11:48:37 -04:00
..
Kconfig
Makefile
TODO staging: refresh TODO for rtl8712 2016-03-22 22:22:13 -04:00
basic_types.h staging: rtl8712: Fixed FSF address warning in basic_types.h 2016-03-28 07:30:36 -07:00
drv_types.h staging: rtl8712: Fixed FSF address warning in drv_types.h 2016-03-28 07:30:36 -07:00
ethernet.h staging: rtl8712: Fixed FSF address warning in ethernet.h 2016-03-28 07:30:36 -07:00
hal_init.c staging: rtl8712: changed typecast to __le 2017-01-03 16:51:16 +01:00
ieee80211.c staging: rtl8712: Moved logical OR operator to previous line. 2017-03-06 09:17:01 +01:00
ieee80211.h staging: rtl8712u: Fix endian settings for structs describing network packets 2017-02-12 13:26:55 +01:00
mlme_linux.c staging: rtl8712: code style fix 2017-04-08 17:05:59 +02:00
mlme_osdep.h
mp_custom_oid.h
os_intfs.c staging: rtl8712: Remove space after a cast. 2017-03-06 09:17:03 +01:00
osdep_intf.h rtl8712: intf_priv: Replace semaphore lock with completion 2016-08-21 18:25:47 +02:00
osdep_service.h sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
recv_linux.c staging: r8712u: Fix leak of skb 2016-08-21 18:28:49 +02:00
recv_osdep.h
rtl871x_cmd.c staging : rtl8712: Free memory when kmalloc fails 2016-11-07 11:24:52 +01:00
rtl871x_cmd.h Staging: rtl8712: rtl871x_cmd.h - block comments 2017-03-06 09:17:03 +01:00
rtl871x_debug.h
rtl871x_eeprom.c
rtl871x_eeprom.h
rtl871x_event.h Staging: rtl8712: rtl871x_event.h - style fix 2017-03-06 09:17:03 +01:00
rtl871x_ht.h staging: rtl8712: checkpatch cleanup: block comments using a trailing */ 2016-09-12 11:43:52 +02:00
rtl871x_io.c Staging: rtl8712: Clean up tests if NULL returned on failure 2016-03-11 22:09:09 -08:00
rtl871x_io.h Staging: rtl8712: rtl871x_io.h - style fix 2017-03-06 09:17:03 +01:00
rtl871x_ioctl.h staging: rtl8712: checkpatch cleanup: block comments using a trailing */ 2016-09-12 11:43:52 +02:00
rtl871x_ioctl_linux.c staging: rtl8712: Invert comparison to reduce indentation 2017-03-23 14:24:45 +01:00
rtl871x_ioctl_rtl.c staging: rtl8712: checkpatch: Avoid multiple line dereferences 2017-03-21 08:44:55 +01:00
rtl871x_ioctl_rtl.h
rtl871x_ioctl_set.c staging: rtl8712: Fix coding style warnings on Block comments 2016-11-21 11:15:18 +01:00
rtl871x_ioctl_set.h
rtl871x_led.h staging: rtl8712: checkpatch cleanup: block comments using a trailing */ 2016-09-12 11:43:52 +02:00
rtl871x_mlme.c staging: r8712u: Fix Sparse warnings in rtl871x_mlme.c 2017-02-12 13:26:55 +01:00
rtl871x_mlme.h Staging: rtl8712: rtl871x_mlme.h - style fix 2017-03-06 09:17:03 +01:00
rtl871x_mp.c staging: rtl8712: checkpatch cleanup: block comments using a trailing */ 2016-09-12 11:43:52 +02:00
rtl871x_mp.h staging: rtl8712: checkpatch cleanup: block comments using a trailing */ 2016-09-12 11:43:52 +02:00
rtl871x_mp_ioctl.c Staging: rtl8712: fix spelling errors 2017-01-25 11:33:21 +01:00
rtl871x_mp_ioctl.h Staging: rtl8712: rtl871x_mp_ioctl.h - style fix 2017-03-09 17:37:21 +01:00
rtl871x_mp_phy_regdef.h staging: rtl8712: checkpatch cleanup: block comments using a trailing */ 2016-09-12 11:43:52 +02:00
rtl871x_pwrctrl.c staging: rtl8712: Fix coding style warnings on Block comments 2016-11-21 11:15:18 +01:00
rtl871x_pwrctrl.h Staging: rtl8712: rtl871x_pwrctrl.h - style fix 2017-03-06 09:17:03 +01:00
rtl871x_recv.c staging: r8712u: Fix Sparse endian warning in rtl871x_recv.c 2017-02-12 13:26:55 +01:00
rtl871x_recv.h Staging: rtl8712: rtl871x_recv.h - style fix 2017-03-06 09:17:03 +01:00
rtl871x_rf.h
rtl871x_security.c Staging: rtl8712: fix spelling errors 2017-01-25 11:33:21 +01:00
rtl871x_security.h staging: rtl8712: checkpatch cleanup: block comments using a trailing */ 2016-09-12 11:43:52 +02:00
rtl871x_sta_mgt.c staging: rtl8712: checkpatch cleanup: block comments using a trailing */ 2016-09-12 11:43:52 +02:00
rtl871x_wlan_sme.h
rtl871x_xmit.c staging: rtl8712: fixed multiple line derefence issue 2017-04-08 17:05:59 +02:00
rtl871x_xmit.h Staging: rtl8712: remove unused functions 2016-10-16 10:24:51 +02:00
rtl8712_bitdef.h
rtl8712_cmd.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
rtl8712_cmd.h
rtl8712_cmdctrl_bitdef.h
rtl8712_cmdctrl_regdef.h
rtl8712_debugctrl_bitdef.h
rtl8712_debugctrl_regdef.h
rtl8712_edcasetting_bitdef.h
rtl8712_edcasetting_regdef.h
rtl8712_efuse.c Staging: rtl8712: rtl8712_efuse: Use !x instead of x == NULL. 2016-09-20 13:37:59 +02:00
rtl8712_efuse.h
rtl8712_event.h staging: rtl8712: changed function argument to __le32 2017-01-03 16:51:16 +01:00
rtl8712_fifoctrl_bitdef.h
rtl8712_fifoctrl_regdef.h
rtl8712_gp_bitdef.h
rtl8712_gp_regdef.h
rtl8712_hal.h Staging:rtl8712: Fixed coding style issue 2016-12-06 10:18:07 +01:00
rtl8712_interrupt_bitdef.h
rtl8712_io.c staging: rtl8712: Cleanup _io_ops wrappers 2016-02-07 19:50:09 -08:00
rtl8712_led.c staging: rtl8712: fix bad indentation 2017-03-12 15:27:40 +01:00
rtl8712_macsetting_bitdef.h
rtl8712_macsetting_regdef.h
rtl8712_powersave_bitdef.h
rtl8712_powersave_regdef.h
rtl8712_ratectrl_bitdef.h
rtl8712_ratectrl_regdef.h
rtl8712_recv.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
rtl8712_recv.h staging: rtl8712: changed struct members to __le32 2017-01-03 16:49:19 +01:00
rtl8712_regdef.h
rtl8712_security_bitdef.h
rtl8712_spec.h staging: rtl8712: checkpatch cleanup: block comments using a trailing */ 2016-09-12 11:43:52 +02:00
rtl8712_syscfg_bitdef.h staging: rtl8712: checkpatch cleanup: block comments using a trailing */ 2016-09-12 11:43:52 +02:00
rtl8712_syscfg_regdef.h
rtl8712_timectrl_bitdef.h
rtl8712_timectrl_regdef.h
rtl8712_wmac_bitdef.h
rtl8712_wmac_regdef.h
rtl8712_xmit.c staging: rtl8712: Fix some Sparse endian messages 2017-02-12 13:26:55 +01:00
rtl8712_xmit.h staging: rtl8712: changed variables to __le32 2017-01-03 16:51:16 +01:00
sta_info.h
usb_halinit.c staging: rtl8712: checkpatch cleanup: block comments using a trailing */ 2016-09-12 11:43:52 +02:00
usb_intf.c staging: rtl8172: usb_intf.c: Fixed block comment coding style 2016-09-26 22:22:13 +02:00
usb_ops.c staging: rtl8712: changed u32 to __le32 2017-01-03 16:51:16 +01:00
usb_ops.h
usb_ops_linux.c staging: rtl8712: changed uint to __le32 2017-01-03 16:51:16 +01:00
usb_osintf.h
wifi.h Staging: rtl8712: wifi.h - style fix 2017-03-06 09:17:03 +01:00
wlan_bssdef.h Staging: rtl8712: wlan_bssdef.h - style fix 2017-03-06 09:17:03 +01:00
xmit_linux.c staging: r8712u: Handle some false positives from kmemleak 2016-08-21 18:28:49 +02:00
xmit_osdep.h