linux/drivers/net/wireless/ti/wlcore
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
..
acx.c wlcore: Pass win_size taken from ieee80211_sta to FW 2016-11-17 08:38:04 +02:00
acx.h wlcore: Pass win_size taken from ieee80211_sta to FW 2016-11-17 08:38:04 +02:00
boot.c wlcore: Fix config firmware loading issues 2016-09-26 18:13:45 +03:00
boot.h
cmd.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
cmd.h cfg80211: remove enum ieee80211_band 2016-04-12 15:56:15 +02:00
conf.h wlcore: split wl12xx/wl18xx sg parameters 2015-12-11 13:10:59 +02:00
debug.h
debugfs.c wlcore: use memdup_user 2017-05-18 16:41:23 +03:00
debugfs.h
event.c mac80211: Pass new RSSI level in CQM RSSI notification 2017-02-08 10:43:04 +01:00
event.h wlcore/wl18xx: fw logger over sdio 2015-12-31 10:19:47 +02:00
hw_ops.h
ini.h
init.c scripts/spelling.txt: add "intialization" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
init.h
io.c wlcore/wl12xx: Fix fw logger over sdio 2016-05-11 21:26:15 +03:00
io.h wlcore/wl12xx: Fix fw logger over sdio 2016-05-11 21:26:15 +03:00
Kconfig wlcore/wl12xx: spi: add device tree support 2016-01-29 11:10:10 +02:00
main.c networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
Makefile Makefile: drop -D__CHECK_ENDIAN__ from cflags 2016-12-16 00:13:43 +02:00
ps.c cfg80211: remove enum ieee80211_band 2016-04-12 15:56:15 +02:00
ps.h
rx.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
rx.h cfg80211: remove enum ieee80211_band 2016-04-12 15:56:15 +02:00
scan.c mac80211: Add support for beacon report radio measurement 2016-07-06 14:53:19 +02:00
scan.h
sdio.c wlcore: print the sdio buffer after reading it 2017-01-28 09:11:08 +02:00
spi.c wlcore: fix 64K page support 2017-05-24 16:42:27 +03:00
sysfs.c wlcore/wl18xx: fw logger over sdio 2015-12-31 10:19:47 +02:00
sysfs.h
testmode.c netlink: pass extended ACK struct to parsing functions 2017-04-13 13:58:22 -04:00
testmode.h
tx.c cfg80211: remove enum ieee80211_band 2016-04-12 15:56:15 +02:00
tx.h cfg80211: remove enum ieee80211_band 2016-04-12 15:56:15 +02:00
vendor_cmd.c netlink: pass extended ACK struct to parsing functions 2017-04-13 13:58:22 -04:00
vendor_cmd.h
wl12xx_80211.h
wlcore_i.h wlcore: Fix config firmware loading issues 2016-09-26 18:13:45 +03:00
wlcore.h wl18xx: add time sync configuration api 2016-09-03 20:02:34 +03:00