linux/drivers/staging/rtl8192e
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
..
rtl8192e staging: rtl8192e: rtl92e_get_eeprom_size Fix read size of EPROM_CMD. 2017-05-15 11:48:45 +02:00
dot11d.c staging: rtl8192e: Fixed coding style wornings on Block comments. 2016-11-15 11:01:54 +01:00
dot11d.h staging: rtl8192e: Aligning the * on each line in block comments 2017-02-02 13:12:22 +01:00
Kconfig
license
Makefile Makefile: drop -D__CHECK_ENDIAN__ from cflags 2016-12-16 00:13:43 +02:00
rtl819x_BA.h Staging: rtl8192e - fixed style of block comments 2017-03-23 14:28:47 +01:00
rtl819x_BAProc.c staging: rtl8192e: replace explicit NULL comparison 2017-03-06 09:17:01 +01:00
rtl819x_HT.h Staging: rtl8192e - fixed style of block comments 2017-03-23 14:28:47 +01:00
rtl819x_HTProc.c staging: rtl8192e: Remove useless parentheses 2017-03-06 09:17:01 +01:00
rtl819x_Qos.h Staging: rtl8192e - fixed style of block comments 2017-03-23 14:28:47 +01:00
rtl819x_TS.h Staging: rtl8192e - fixed style of block comments 2017-03-23 14:28:47 +01:00
rtl819x_TSProc.c staging: rtl8192e: GetTs Fix invalid TID 7 warning. 2017-05-15 11:48:45 +02:00
rtllib_crypt_ccmp.c staging: rtl8192e: Prefer using macro DIV_ROUND_UP 2016-03-11 22:09:09 -08:00
rtllib_crypt_tkip.c Staging driver patches for 4.6-rc1 2016-03-17 22:13:41 -07:00
rtllib_crypt_wep.c
rtllib_debug.h Staging: rtl8192e - fixed style of block comments 2017-03-23 14:28:47 +01:00
rtllib_module.c Staging: rtl8192e - fixed style of block comments 2017-03-23 14:28:47 +01:00
rtllib_rx.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
rtllib_softmac_wx.c rtl8192e: rtllib_device: Replace semaphore wx_sem with mutex 2016-08-21 18:22:31 +02:00
rtllib_softmac.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
rtllib_tx.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
rtllib_wx.c Staging: rtl8192e - fixed style of block comments 2017-03-23 14:28:47 +01:00
rtllib.h Staging: rtl8192e - fixed style of block comments 2017-03-23 14:28:47 +01:00
TODO