-
- Downloads
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>
Showing
- drivers/atm/atmtcp.c 2 additions, 2 deletionsdrivers/atm/atmtcp.c
- drivers/atm/solos-pci.c 6 additions, 6 deletionsdrivers/atm/solos-pci.c
- drivers/bluetooth/bluecard_cs.c 1 addition, 1 deletiondrivers/bluetooth/bluecard_cs.c
- drivers/bluetooth/bt3c_cs.c 1 addition, 1 deletiondrivers/bluetooth/bt3c_cs.c
- drivers/bluetooth/btmrvl_main.c 1 addition, 1 deletiondrivers/bluetooth/btmrvl_main.c
- drivers/bluetooth/btuart_cs.c 1 addition, 1 deletiondrivers/bluetooth/btuart_cs.c
- drivers/bluetooth/btusb.c 5 additions, 5 deletionsdrivers/bluetooth/btusb.c
- drivers/bluetooth/dtl1_cs.c 2 additions, 2 deletionsdrivers/bluetooth/dtl1_cs.c
- drivers/bluetooth/hci_bcm.c 3 additions, 3 deletionsdrivers/bluetooth/hci_bcm.c
- drivers/bluetooth/hci_intel.c 3 additions, 3 deletionsdrivers/bluetooth/hci_intel.c
- drivers/bluetooth/hci_ll.c 1 addition, 1 deletiondrivers/bluetooth/hci_ll.c
- drivers/bluetooth/hci_nokia.c 5 additions, 5 deletionsdrivers/bluetooth/hci_nokia.c
- drivers/bluetooth/hci_qca.c 1 addition, 1 deletiondrivers/bluetooth/hci_qca.c
- drivers/bluetooth/hci_vhci.c 2 additions, 2 deletionsdrivers/bluetooth/hci_vhci.c
- drivers/crypto/chelsio/chcr_algo.c 5 additions, 5 deletionsdrivers/crypto/chelsio/chcr_algo.c
- drivers/infiniband/core/addr.c 1 addition, 2 deletionsdrivers/infiniband/core/addr.c
- drivers/infiniband/core/sa_query.c 1 addition, 2 deletionsdrivers/infiniband/core/sa_query.c
- drivers/infiniband/hw/cxgb3/cxio_hal.c 1 addition, 1 deletiondrivers/infiniband/hw/cxgb3/cxio_hal.c
- drivers/infiniband/hw/cxgb3/iwch_cm.c 11 additions, 11 deletionsdrivers/infiniband/hw/cxgb3/iwch_cm.c
- drivers/infiniband/hw/cxgb4/cm.c 9 additions, 13 deletionsdrivers/infiniband/hw/cxgb4/cm.c
Loading
Please register or sign in to comment