kernel_optimize_test/net
Johannes Berg b080db5853 networking: convert many more places to skb_put_zero()
There were many places that my previous spatch didn't find,
as pointed out by yuan linyu in various patches.

The following spatch found many more and also removes the
now unnecessary casts:

    @@
    identifier p, p2;
    expression len;
    expression skb;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_zero(skb, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_zero(skb, len);
    )
    ... when != p
    (
    p2 = (t2)p;
    -memset(p2, 0, len);
    |
    -memset(p, 0, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_zero(skb, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_zero(skb, sizeof(t));
    )
    ... when != p
    (
    p2 = (t2)p;
    -memset(p2, 0, sizeof(*p));
    |
    -memset(p, 0, sizeof(*p));
    )

    @@
    expression skb, len;
    @@
    -memset(skb_put(skb, len), 0, len);
    +skb_put_zero(skb, len);

Apply it to the tree (with one manual fixup to keep the
comment in vxlan.c, which spatch removed.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 11:48:35 -04:00
..
6lowpan
9p
802
8021q Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-15 11:59:32 -04:00
appletalk
atm networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
ax25
batman-adv networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
bluetooth Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-15 11:59:32 -04:00
bpf
bridge networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
caif Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-15 11:59:32 -04:00
can can: af_can: namespace support: fix lockdep splat: properly initialize spin_lock 2017-06-09 11:39:23 +02:00
ceph
core networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
dcb
dccp
decnet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-15 11:59:32 -04:00
dns_resolver
dsa net: dsa: assign default CPU port to all ports 2017-06-15 17:23:35 -04:00
ethernet
hsr hsr: fix incorrect warning 2017-06-12 15:21:20 -04:00
ieee802154 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-15 11:59:32 -04:00
ife
ipv4 networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
ipv6 networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
ipx
irda
iucv
kcm
key networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
l2tp l2tp: cast l2tp traffic counter to unsigned 2017-06-10 16:14:27 -04:00
l3mdev
lapb
llc
mac80211 networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
mac802154
mpls
ncsi networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
netfilter
netlabel
netlink
netrom
nfc
openvswitch networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
packet net/packet: remove unneeded declaraion of tpacket_snd(). 2017-06-10 16:15:25 -04:00
phonet
psample
qrtr networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
rds
rfkill net: rfkill: gpio: Switch to devm_acpi_dev_add_driver_gpios() 2017-06-13 11:07:51 +02:00
rose
rxrpc networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
sched net: sched: act_tunnel_key: make UDP checksum configurable 2017-06-15 14:21:03 -04:00
sctp networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
smc
strparser
sunrpc
switchdev net: switchdev: Change notifier chain to be atomic 2017-06-08 14:16:24 -04:00
tipc net: tipc: Fix a sleep-in-atomic bug in tipc_msg_reverse 2017-06-10 18:20:38 -04:00
tls tls: Depend upon INET not plain NET. 2017-06-16 11:28:49 -04:00
unix af_unix: Add sockaddr length checks before accessing sa_family in bind and connect handlers 2017-06-09 10:10:24 -04:00
vmw_vsock
wimax
wireless nl80211: add authorized flag to ROAM event 2017-06-13 11:04:37 +02:00
x25
xfrm
compat.c
Kconfig tls: kernel TLS support 2017-06-15 12:12:40 -04:00
Makefile tls: kernel TLS support 2017-06-15 12:12:40 -04:00
socket.c
sysctl_net.c