linux_dsm_epyc7002/drivers/s390/net
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
..
ctcm_dbug.c s390/s390dbf: use debug_level_enabled() where applicable 2013-10-24 17:16:54 +02:00
ctcm_dbug.h s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
ctcm_fsms.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
ctcm_fsms.h s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
ctcm_main.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
ctcm_main.h s390/ctcm, netiucv: migrate variables to handle y2038 problem 2015-01-17 23:54:59 -05:00
ctcm_mpc.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
ctcm_mpc.h s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
ctcm_sysfs.c s390/ctcm, netiucv: migrate variables to handle y2038 problem 2015-01-17 23:54:59 -05:00
fsm.c
fsm.h
Kconfig s390: remove claw driver 2015-02-28 23:38:29 -05:00
lcs.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
lcs.h s390/s390dbf: use debug_level_enabled() where applicable 2013-10-24 17:16:54 +02:00
Makefile s390: remove claw driver 2015-02-28 23:38:29 -05:00
netiucv.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
qeth_core_main.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
qeth_core_mpc.c s390/qeth: add missing strings for IPA return codes 2017-06-06 13:05:00 -04:00
qeth_core_mpc.h s390/qeth: remove support for IPA_IP_FRAGMENTATION 2017-06-06 13:04:59 -04:00
qeth_core_sys.c s390/qeth: do early device setup for z/VM IQD NICs 2017-06-06 13:05:01 -04:00
qeth_core.h s390/qeth: do early device setup for z/VM IQD NICs 2017-06-06 13:05:01 -04:00
qeth_l2_main.c s390/qeth: log bridgeport capabilities 2017-06-06 13:05:00 -04:00
qeth_l2_sys.c s390/qeth: unbreak OSM and OSN support 2017-05-11 12:37:48 -04:00
qeth_l2.h s390/qeth: unbreak OSM and OSN support 2017-05-11 12:37:48 -04:00
qeth_l3_main.c s390/qeth: add support for early L3 device setup 2017-06-06 13:05:01 -04:00
qeth_l3_sys.c s390/qeth: add support for early L3 device setup 2017-06-06 13:05:01 -04:00
qeth_l3.h s390/qeth: add support for early L3 device setup 2017-06-06 13:05:01 -04:00
smsgiucv_app.c Driver core: driver_find() drops reference before returning 2012-01-24 16:00:34 -08:00
smsgiucv.c s390/iucv: do not use arrays as argument 2015-09-21 16:03:04 -07:00
smsgiucv.h s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00