networking: convert many more places to skb_put_zero()
authorJohannes Berg <johannes.berg@intel.com>
Fri, 16 Jun 2017 12:29:19 +0000 (14:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Jun 2017 15:48:35 +0000 (11:48 -0400)
commitb080db585384b9f037e015c0c28d1ad33be41dfc
treeea9cc5c3161d776b948283a3d4f483cbf578e043
parent61f73d1ea4c68544b959228ead7ef5c021791b14
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>
49 files changed:
drivers/infiniband/hw/cxgb3/cxio_hal.c
drivers/infiniband/hw/cxgb3/iwch_cm.c
drivers/infiniband/hw/cxgb3/iwch_qp.c
drivers/infiniband/hw/cxgb4/cm.c
drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c
drivers/net/usb/cdc_ncm.c
drivers/net/usb/kalmia.c
drivers/net/vxlan.c
drivers/net/wireless/ath/ath9k/channel.c
drivers/net/wireless/intersil/hostap/hostap_ap.c
drivers/net/wireless/intersil/hostap/hostap_main.c
drivers/net/wireless/intersil/p54/txrx.c
drivers/net/wireless/marvell/mwifiex/cmdevt.c
drivers/net/wireless/marvell/mwifiex/tdls.c
drivers/net/wireless/quantenna/qtnfmac/commands.c
drivers/net/wireless/realtek/rtlwifi/base.c
drivers/net/wireless/ti/wlcore/cmd.c
drivers/net/wireless/ti/wlcore/main.c
drivers/scsi/fcoe/fcoe_ctlr.c
drivers/scsi/libfc/fc_libfc.c
drivers/usb/gadget/function/f_ncm.c
net/atm/signaling.c
net/batman-adv/bat_v_elp.c
net/bridge/netfilter/nft_reject_bridge.c
net/core/pktgen.c
net/ipv4/ipconfig.c
net/ipv4/netfilter/nf_reject_ipv4.c
net/ipv6/mcast.c
net/key/af_key.c
net/mac80211/agg-rx.c
net/mac80211/agg-tx.c
net/mac80211/debugfs_netdev.c
net/mac80211/ht.c
net/mac80211/mesh.c
net/mac80211/mesh_hwmp.c
net/mac80211/mesh_plink.c
net/mac80211/mesh_ps.c
net/mac80211/mlme.c
net/mac80211/rx.c
net/mac80211/spectmgmt.c
net/mac80211/tdls.c
net/mac80211/tx.c
net/mac80211/util.c
net/ncsi/ncsi-cmd.c
net/openvswitch/datapath.c
net/qrtr/qrtr.c
net/rxrpc/sendmsg.c
net/sctp/output.c
net/sctp/sm_make_chunk.c