networking: make skb_push & __skb_push return void pointers
authorJohannes Berg <johannes.berg@intel.com>
Fri, 16 Jun 2017 12:29:23 +0000 (14:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Jun 2017 15:48:40 +0000 (11:48 -0400)
commitd58ff35122847a83ba55394e2ae3a1527b6febf5
treee1ecf758e86519922c403f1aa88f19ef25a554ad
parentaf72868b9070d1b843c829f0d0d0b22c04a20815
networking: make skb_push & __skb_push 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 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_push, __skb_push, skb_push_rcsum };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    @@
    expression SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - fn(SKB, LEN)[0]
    + *(u8 *)fn(SKB, LEN)

Note that the last part there converts from push(...)[0] to the
more idiomatic *(u8 *)push(...).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
126 files changed:
drivers/atm/solos-pci.c
drivers/bluetooth/bpa10x.c
drivers/firewire/net.c
drivers/infiniband/hw/cxgb3/iwch_cm.c
drivers/infiniband/hw/cxgb4/cm.c
drivers/infiniband/ulp/ipoib/ipoib_main.c
drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c
drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c
drivers/isdn/i4l/isdn_ppp.c
drivers/net/arcnet/arc-rawmode.c
drivers/net/arcnet/capmode.c
drivers/net/arcnet/rfc1051.c
drivers/net/arcnet/rfc1201.c
drivers/net/ethernet/broadcom/bcmsysport.c
drivers/net/ethernet/chelsio/cxgb/sge.c
drivers/net/ethernet/freescale/gianfar.c
drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c
drivers/net/ethernet/sun/niu.c
drivers/net/ethernet/toshiba/ps3_gelic_net.c
drivers/net/geneve.c
drivers/net/gtp.c
drivers/net/hippi/rrunner.c
drivers/net/macsec.c
drivers/net/ppp/ppp_async.c
drivers/net/ppp/ppp_generic.c
drivers/net/ppp/ppp_synctty.c
drivers/net/ppp/pptp.c
drivers/net/usb/gl620a.c
drivers/net/usb/int51x1.c
drivers/net/usb/kaweth.c
drivers/net/usb/lg-vl600.c
drivers/net/usb/net1080.c
drivers/net/usb/qmi_wwan.c
drivers/net/usb/rndis_host.c
drivers/net/vrf.c
drivers/net/vxlan.c
drivers/net/wimax/i2400m/netdev.c
drivers/net/wireless/admtek/adm8211.c
drivers/net/wireless/ath/ar5523/ar5523.c
drivers/net/wireless/ath/ath6kl/htc_pipe.c
drivers/net/wireless/ath/ath9k/hif_usb.c
drivers/net/wireless/ath/ath9k/htc_hst.c
drivers/net/wireless/ath/ath9k/wmi.c
drivers/net/wireless/ath/carl9170/tx.c
drivers/net/wireless/ath/wil6210/txrx.c
drivers/net/wireless/intersil/hostap/hostap_80211_rx.c
drivers/net/wireless/intersil/orinoco/main.c
drivers/net/wireless/intersil/p54/txrx.c
drivers/net/wireless/intersil/prism54/islpci_eth.c
drivers/net/wireless/mac80211_hwsim.c
drivers/net/wireless/marvell/libertas/rx.c
drivers/net/wireless/marvell/libertas_tf/main.c
drivers/net/wireless/mediatek/mt7601u/tx.c
drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
drivers/net/wireless/st/cw1200/txrx.c
drivers/net/wireless/ti/wl1251/tx.c
drivers/net/wireless/ti/wlcore/cmd.c
drivers/net/wireless/ti/wlcore/tx.c
drivers/net/wireless/zydas/zd1211rw/zd_mac.c
drivers/nfc/fdp/i2c.c
drivers/nfc/microread/i2c.c
drivers/nfc/microread/microread.c
drivers/nfc/nfcmrvl/main.c
drivers/nfc/pn533/pn533.c
drivers/nfc/pn544/i2c.c
drivers/nfc/pn544/pn544.c
drivers/nfc/st-nci/ndlc.c
drivers/nfc/st21nfca/core.c
drivers/nfc/st21nfca/dep.c
drivers/nfc/st21nfca/i2c.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
drivers/scsi/fcoe/fcoe_ctlr.c
drivers/scsi/fnic/fnic_fcs.c
drivers/scsi/qedf/qedf_fip.c
drivers/staging/wilc1000/linux_mon.c
drivers/staging/wlan-ng/p80211conv.c
drivers/target/iscsi/cxgbit/cxgbit_target.c
drivers/usb/gadget/function/rndis.c
include/linux/if_vlan.h
include/linux/skbuff.h
net/802/fc.c
net/802/fddi.c
net/802/hippi.c
net/8021q/vlan_dev.c
net/appletalk/ddp.c
net/ax25/af_ax25.c
net/bluetooth/hci_sock.c
net/bluetooth/mgmt_util.c
net/bluetooth/rfcomm/core.c
net/bridge/netfilter/nft_reject_bridge.c
net/core/netpoll.c
net/core/pktgen.c
net/core/skbuff.c
net/dccp/options.c
net/decnet/dn_dev.c
net/ethernet/eth.c
net/ipv4/esp4.c
net/ipv4/ip_gre.c
net/ipv6/esp6.c
net/ipv6/exthdrs.c
net/ipv6/ip6_gre.c
net/ipv6/ip6_output.c
net/ipv6/tcp_ipv6.c
net/irda/irnet/irnet_irda.c
net/iucv/af_iucv.c
net/mac80211/rx.c
net/mac80211/status.c
net/mac80211/tx.c
net/ncsi/ncsi-cmd.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/data.c
net/nfc/nci/hci.c
net/nfc/nci/spi.c
net/nfc/rawsock.c
net/sctp/output.c
net/sctp/sm_statefuns.c
net/sctp/ulpevent.c
net/wireless/util.c