linux_dsm_epyc7002/drivers/isdn/hisax
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
..
amd7930_fn.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
amd7930_fn.h
arcofi.c isdn: use setup_timer 2017-03-24 12:33:42 -07:00
arcofi.h
asuscom.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
avm_a1.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
avm_a1p.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
avm_pci.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
avma1_cs.c drivers/isdn: use module_pcmcia_driver() in pcmcia drivers 2013-03-15 12:26:04 -07:00
bkm_a4t.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
bkm_a8.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
bkm_ax.h
callc.c isdn: Fix typo in drivers/isdn 2012-11-09 17:10:16 -05:00
config.c Annotate hardware config module parameters in drivers/isdn/ 2017-04-20 12:02:32 +01:00
diva.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
elsa_cs.c drivers/isdn: use module_pcmcia_driver() in pcmcia drivers 2013-03-15 12:26:04 -07:00
elsa_ser.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
elsa.c isdn: use setup_timer 2017-03-24 12:33:42 -07:00
enternow_pci.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
fsm.c isdn: use setup_timer 2017-03-24 12:33:42 -07:00
fsm.h
gazel.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
hfc4s8s_l1.c isdn: use setup_timer 2017-03-24 12:33:42 -07:00
hfc4s8s_l1.h
hfc_2bds0.c isdn: use setup_timer 2017-03-24 12:33:42 -07:00
hfc_2bds0.h
hfc_2bs0.c isdn: fix misspelling of current function in string 2014-12-09 16:18:46 -05:00
hfc_2bs0.h
hfc_pci.c isdn: use setup_timer 2017-03-24 12:33:42 -07:00
hfc_pci.h
hfc_sx.c isdn: use setup_timer 2017-03-24 12:33:42 -07:00
hfc_sx.h
hfc_usb.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hfc_usb.h
hfcscard.c isdn: use setup_timer 2017-03-24 12:33:42 -07:00
hisax_cfg.h
hisax_debug.h
hisax_fcpcipnp.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hisax_fcpcipnp.h
hisax_if.h
hisax_isac.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hisax_isac.h
hisax.h isdn: Constify some function parameters 2016-12-17 21:46:35 -05:00
hscx_irq.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hscx.c
hscx.h
icc.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
icc.h
ipac.h
ipacx.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
ipacx.h
isac.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
isac.h
isar.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
isar.h
isdnl1.c isdn: fix misspelling of current function in string 2014-12-09 16:18:46 -05:00
isdnl1.h
isdnl2.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
isdnl2.h
isdnl3.c isdn: use setup_timer 2017-03-24 12:33:42 -07:00
isdnl3.h
isurf.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
ix1_micro.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
jade_irq.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
jade.c isdn: clean up debug format string usage 2013-09-13 20:02:50 -04:00
jade.h
Kconfig isdn: disable HiSax NetJet driver on microblaze arch 2015-06-21 09:53:01 -07:00
l3_1tr6.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
l3_1tr6.h
l3dss1.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
l3dss1.h
l3ni1.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
l3ni1.h
lmgr.c
Makefile
mic.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
netjet.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
netjet.h
niccy.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
nj_s.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
nj_u.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
q931.c treewide: Fix printk() message errors 2016-12-14 10:54:27 +01:00
s0box.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
saphir.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
sedlbauer_cs.c drivers/isdn: use module_pcmcia_driver() in pcmcia drivers 2013-03-15 12:26:04 -07:00
sedlbauer.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
sportster.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
st5481_b.c scripts/spelling.txt: add "disble(d)" pattern and fix typo instances 2017-03-09 17:01:09 -08:00
st5481_d.c
st5481_init.c
st5481_usb.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
st5481.h
tei.c
teleint.c isdn: use setup_timer 2017-03-24 12:33:42 -07:00
teles0.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
teles3.c Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
teles_cs.c drivers/isdn: use module_pcmcia_driver() in pcmcia drivers 2013-03-15 12:26:04 -07:00
telespci.c isdn: Drop big endian cpp checks from telespci and hfc_pci drivers 2014-01-06 15:50:51 -05:00
w6692.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
w6692.h