kernel_optimize_test/net/core
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
..
datagram.c net: factor out a helper to decrement the skb refcount 2017-06-12 10:01:29 -04:00
dev_addr_lists.c
dev_ioctl.c net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL 2017-05-21 13:37:32 -04:00
dev.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-15 11:59:32 -04:00
devlink.c devlink: fix potential memort leak 2017-06-05 11:24:28 -04:00
drop_monitor.c
dst_cache.c
dst.c Fix an intermittent pr_emerg warning about lo becoming free. 2017-06-09 12:27:28 -04:00
ethtool.c
fib_rules.c
filter.c bpf: permits narrower load from bpf program context fields 2017-06-14 14:56:25 -04:00
flow_dissector.c net/flow_dissector: add support for dissection of misc ip header fields 2017-06-04 18:12:23 -04:00
flow.c
gen_estimator.c
gen_stats.c
gro_cells.c
hwbm.c
link_watch.c
lwt_bpf.c net: add extack arg to lwtunnel build state 2017-05-30 11:55:32 -04:00
lwtunnel.c net: add extack arg to lwtunnel build state 2017-05-30 11:55:32 -04:00
Makefile
neighbour.c neigh: Really delete an arp/neigh entry on "ip neigh delete" or "arp -d" 2017-06-04 21:37:18 -04:00
net_namespace.c netns: fix error code when the nsid is already used 2017-06-10 15:58:50 -04:00
net-procfs.c net-procfs: Use vsnprintf extension %phN 2017-06-04 19:52:58 -04:00
net-sysfs.c
net-sysfs.h
net-traces.c
netclassid_cgroup.c
netevent.c
netpoll.c
netprio_cgroup.c
pktgen.c networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
ptp_classifier.c
request_sock.c
rtnetlink.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-15 11:59:32 -04:00
scm.c
secure_seq.c tcp: Namespaceify sysctl_tcp_timestamps 2017-06-08 10:53:29 -04:00
skbuff.c net: use skb_unref() in napi_consume_skb() 2017-06-14 15:23:51 -04:00
sock_diag.c
sock_reuseport.c
sock.c tcp: add TCPMemoryPressuresChrono counter 2017-06-08 11:26:19 -04:00
stream.c
sysctl_net_core.c net: move somaxconn init from sysctl code 2017-05-25 13:12:17 -04:00
timestamping.c
tso.c
utils.c