kernel_optimize_test/net/sctp
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
..
associola.c sctp: no need to check assoc id before calling sctp_assoc_set_id 2017-06-10 16:23:31 -04:00
auth.c
bind_addr.c
chunk.c sctp: define the member stream as an object instead of pointer in asoc 2017-06-02 13:56:26 -04:00
debug.c
endpointola.c
input.c sctp: fix ICMP processing if skb is non-linear 2017-05-26 14:40:46 -04:00
inqueue.c
ipv6.c sctp: do not inherit ipv6_{mc|ac|fl}_list from parent 2017-05-18 10:24:08 -04:00
Kconfig
Makefile
objcnt.c
offload.c net: use skb->csum_not_inet to identify packets needing crc32c 2017-05-19 19:21:29 -04:00
output.c networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
outqueue.c sctp: define the member stream as an object instead of pointer in asoc 2017-06-02 13:56:26 -04:00
primitive.c
probe.c
proc.c sctp: use read_lock_bh in sctp_eps_seq_show 2017-06-10 16:22:26 -04:00
protocol.c
sctp_diag.c
sm_make_chunk.c networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
sm_sideeffect.c
sm_statefuns.c sctp: define the member stream as an object instead of pointer in asoc 2017-06-02 13:56:26 -04:00
sm_statetable.c
socket.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-15 11:59:32 -04:00
stream.c sctp: merge sctp_stream_new and sctp_stream_init 2017-06-02 13:56:26 -04:00
sysctl.c
transport.c sctp: get sock from transport in sctp_transport_update_pmtu 2017-04-05 07:20:06 -07:00
tsnmap.c
ulpevent.c
ulpqueue.c sctp: define the member stream as an object instead of pointer in asoc 2017-06-02 13:56:26 -04:00