linux/drivers/bluetooth
Johannes Berg 634fef6107 networking: add and use skb_put_u8()
Joe and Bjørn suggested that it'd be nicer to not have the
cast in the fairly common case of doing
	*(u8 *)skb_put(skb, 1) = c;

Add skb_put_u8() for this case, and use it across the code,
using the following spatch:

    @@
    expression SKB, C, S;
    typedef u8;
    identifier fn = {skb_put};
    fresh identifier fn2 = fn ## "_u8";
    @@
    - *(u8 *)fn(SKB, S) = C;
    + fn2(SKB, C);

Note that due to the "S", the spatch isn't perfect, it should
have checked that S is 1, but there's also places that use a
sizeof expression like sizeof(var) or sizeof(u8) etc. Turns
out that nobody ever did something like
	*(u8 *)skb_put(skb, 2) = c;

which would be wrong anyway since the second byte wouldn't be
initialized.

Suggested-by: Joe Perches <joe@perches.com>
Suggested-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 11:48:40 -04:00
..
ath3k.c Bluetooth: Add another AR3012 04ca:3018 device 2017-02-16 17:35:23 +01:00
bcm203x.c bluetooth: bcm203x: don't print error when allocating urb fails 2016-09-27 12:20:17 +02:00
bfusb.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
bluecard_cs.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
bpa10x.c networking: make skb_push & __skb_push return void pointers 2017-06-16 11:48:40 -04:00
bt3c_cs.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
btbcm.c Bluetooth: btbcm: Read controller features during configuration 2017-06-12 11:46:12 +02:00
btbcm.h Bluetooth: btbcm: Support the BCM4354 Bluetooth UART device 2015-06-17 18:56:53 +02:00
btintel.c Bluetooth: btintel: Add MODULE_FIRMWARE entries for iBT 3.5 controllers 2017-05-23 19:54:55 +02:00
btintel.h Bluetooth: btintel: Create common Intel Version Read function 2015-12-10 00:51:51 +01:00
btmrvl_debugfs.c Bluetooth: btmrvl add firmware dump support 2014-12-03 17:35:51 +01:00
btmrvl_drv.h Bluetooth: btmrvl: drop duplicate header slab.h 2016-12-08 07:44:56 +01:00
btmrvl_main.c networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
btmrvl_sdio.c Bluetooth: btmrvl: remove unnecessary wakeup interrupt number sanity check 2017-04-12 22:02:40 +02:00
btmrvl_sdio.h btmrvl: add platform specific wakeup interrupt support 2016-05-02 19:26:15 +02:00
btqca.c Bluetooth: btqca: remove null checks on edl->data as it is an array 2016-09-19 20:19:34 +02:00
btqca.h Bluetooth: btqca: Introduce generic QCA ROME support 2015-08-10 23:52:20 +02:00
btqcomsmd.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
btrtl.c Bluetooth: btrtl: Change message for missing config file 2017-04-12 22:02:38 +02:00
btrtl.h Bluetooth: btrtl: Create separate module for Realtek BT driver 2015-05-14 12:04:12 +02:00
btsdio.c Bluetooth: Rename HCI_BREDR into HCI_PRIMARY 2016-07-09 21:37:13 +03:00
btuart_cs.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
btusb.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
btwilink.c Bluetooth: btwilink: Fix unexpected skb free 2017-05-23 16:19:38 +02:00
dtl1_cs.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
hci_ag6xx.c Bluetooth: hci_uart: Add diag and address support for Intel/AG6xx 2016-02-29 19:25:22 +02:00
hci_ath.c Bluetooth: Use new hci_skb_pkt_* wrappers for drivers 2015-11-19 17:50:27 +01:00
hci_bcm.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
hci_bcsp.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hci_h4.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hci_h5.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hci_intel.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
hci_ldisc.c Bluetooth: hci_ldisc: Use rwlocking to avoid closing proto races 2017-05-18 13:52:50 +02:00
hci_ll.c networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
hci_mrvl.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hci_nokia.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
hci_qca.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
hci_serdev.c Bluetooth: hci_serdev: allow modular drivers 2017-04-12 22:12:17 +02:00
hci_uart.h Bluetooth: hci_ldisc: Use rwlocking to avoid closing proto races 2017-05-18 13:52:50 +02:00
hci_vhci.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
Kconfig Bluetooth: hci_nokia: select BT_HCIUART_H4 2017-05-18 13:59:05 +02:00
Makefile Bluetooth: try to improve CONFIG_SERIAL_DEV_BUS dependency 2017-04-22 10:28:40 +02:00