networking: make skb_put & friends return void pointers
authorJohannes Berg <johannes.berg@intel.com>
Fri, 16 Jun 2017 12:29:21 +0000 (14:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Jun 2017 15:48:39 +0000 (11:48 -0400)
commit4df864c1d9afb46e2461a9f808d9f11a42d31bad
tree07e7b3d16b161e0d199c5b8116df277798566e4f
parent59ae1d127ac0ae404baf414c434ba2651b793f46
networking: make skb_put & friends return void pointers

It seems like a historic accident that these return unsigned char *,
and in many places that means casts are required, more often than not.

Make these functions (skb_put, __skb_put and pskb_put) return void *
and remove all the casts across the tree, adding a (u8 *) cast only
where the unsigned char pointer was used directly, all done with the
following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = { skb_put, __skb_put };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_put, __skb_put };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

which actually doesn't cover pskb_put since there are only three
users overall.

A handful of stragglers were converted manually, notably a macro in
drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many
instances in net/bluetooth/hci_sock.c. In the former file, I also
had to fix one whitespace problem spatch introduced.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
145 files changed:
drivers/atm/atmtcp.c
drivers/atm/solos-pci.c
drivers/bluetooth/bluecard_cs.c
drivers/bluetooth/bt3c_cs.c
drivers/bluetooth/btmrvl_main.c
drivers/bluetooth/btuart_cs.c
drivers/bluetooth/btusb.c
drivers/bluetooth/dtl1_cs.c
drivers/bluetooth/hci_bcm.c
drivers/bluetooth/hci_intel.c
drivers/bluetooth/hci_ll.c
drivers/bluetooth/hci_nokia.c
drivers/bluetooth/hci_qca.c
drivers/bluetooth/hci_vhci.c
drivers/crypto/chelsio/chcr_algo.c
drivers/infiniband/core/addr.c
drivers/infiniband/core/sa_query.c
drivers/infiniband/hw/cxgb3/cxio_hal.c
drivers/infiniband/hw/cxgb3/iwch_cm.c
drivers/infiniband/hw/cxgb4/cm.c
drivers/infiniband/hw/cxgb4/cq.c
drivers/infiniband/hw/cxgb4/mem.c
drivers/infiniband/hw/cxgb4/qp.c
drivers/isdn/capi/capi.c
drivers/isdn/gigaset/asyncdata.c
drivers/isdn/gigaset/isocdata.c
drivers/isdn/i4l/isdn_audio.c
drivers/isdn/i4l/isdn_bsdcomp.c
drivers/isdn/i4l/isdn_x25iface.c
drivers/media/dvb-core/dvb_net.c
drivers/media/radio/wl128x/fmdrv_common.c
drivers/net/bonding/bond_3ad.c
drivers/net/can/dev.c
drivers/net/ethernet/allwinner/sun4i-emac.c
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
drivers/net/ethernet/chelsio/cxgb3/l2t.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/chelsio/cxgb4/l2t.c
drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
drivers/net/ethernet/davicom/dm9000.c
drivers/net/ethernet/dnet.c
drivers/net/ethernet/hp/hp100.c
drivers/net/ethernet/intel/i40e/i40e_fcoe.c
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
drivers/net/ethernet/mellanox/mlx4/en_selftest.c
drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c
drivers/net/ethernet/micrel/ks8842.c
drivers/net/ethernet/sfc/falcon/selftest.c
drivers/net/ethernet/sfc/selftest.c
drivers/net/hamradio/scc.c
drivers/net/ppp/pppoe.c
drivers/net/usb/cdc_ncm.c
drivers/net/usb/net1080.c
drivers/net/usb/zaurus.c
drivers/net/wan/hdlc_ppp.c
drivers/net/wireless/ath/ath6kl/debug.c
drivers/net/wireless/ath/ath6kl/htc_pipe.c
drivers/net/wireless/ath/ath9k/htc_hst.c
drivers/net/wireless/ath/wil6210/wmi.c
drivers/net/wireless/cisco/airo.c
drivers/net/wireless/intel/ipw2x00/ipw2200.c
drivers/net/wireless/intel/ipw2x00/libipw_tx.c
drivers/net/wireless/intersil/hostap/hostap_ap.c
drivers/net/wireless/intersil/p54/fwio.c
drivers/net/wireless/mac80211_hwsim.c
drivers/net/wireless/marvell/mwifiex/11n_aggr.c
drivers/net/wireless/marvell/mwifiex/tdls.c
drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
drivers/nfc/fdp/i2c.c
drivers/nfc/microread/i2c.c
drivers/nfc/microread/microread.c
drivers/nfc/nfcmrvl/fw_dnld.c
drivers/nfc/pn533/pn533.c
drivers/nfc/pn544/i2c.c
drivers/nfc/port100.c
drivers/nfc/st21nfca/i2c.c
drivers/nfc/st95hf/core.c
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
drivers/scsi/fcoe/fcoe.c
drivers/scsi/qedf/qedf_main.c
drivers/staging/rtl8192e/rtl819x_BAProc.c
drivers/staging/rtl8192e/rtllib_softmac.c
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
drivers/target/iscsi/cxgbit/cxgbit_cm.c
drivers/target/iscsi/cxgbit/cxgbit_ddp.c
drivers/usb/gadget/function/f_ncm.c
include/linux/skbuff.h
lib/nlattr.c
net/802/garp.c
net/802/mrp.c
net/appletalk/ddp.c
net/atm/clip.c
net/batman-adv/icmp_socket.c
net/batman-adv/tp_meter.c
net/bluetooth/hci_request.c
net/bluetooth/hci_sock.c
net/bluetooth/hidp/core.c
net/bluetooth/l2cap_core.c
net/bluetooth/mgmt_util.c
net/bluetooth/rfcomm/core.c
net/core/pktgen.c
net/core/skbuff.c
net/decnet/dn_dev.c
net/decnet/dn_nsp_out.c
net/ipv4/arp.c
net/ipv4/igmp.c
net/ipv4/ipmr.c
net/ipv4/netfilter/ipt_SYNPROXY.c
net/ipv4/netfilter/nf_reject_ipv4.c
net/ipv6/mcast.c
net/ipv6/ndisc.c
net/ipv6/netfilter/ip6t_SYNPROXY.c
net/ipv6/netfilter/nf_reject_ipv6.c
net/irda/irlap_frame.c
net/key/af_key.c
net/mac80211/cfg.c
net/mac80211/ht.c
net/mac80211/mesh.c
net/mac80211/mesh_ps.c
net/mac80211/sta_info.c
net/mac80211/tdls.c
net/mac80211/tx.c
net/mac80211/wpa.c
net/netfilter/nfnetlink_log.c
net/netfilter/nfnetlink_queue.c
net/netlink/af_netlink.c
net/nfc/digital_core.c
net/nfc/digital_dep.c
net/nfc/digital_technology.c
net/nfc/hci/core.c
net/nfc/hci/llc_shdlc.c
net/nfc/nci/core.c
net/nfc/nci/hci.c
net/nfc/nci/spi.c
net/nfc/nci/uart.c
net/psample/psample.c
net/qrtr/qrtr.c
net/sctp/sm_make_chunk.c
net/sctp/ulpevent.c
net/vmw_vsock/virtio_transport_common.c