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 <[email protected] >
Suggested-by: Bjørn Mork <[email protected] >
Signed-off-by: Johannes Berg <[email protected] >
Signed-off-by: David S. Miller <[email protected] >
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
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
btintel.c
Bluetooth: btintel: Add MODULE_FIRMWARE entries for iBT 3.5 controllers
2017-05-23 19:54:55 +02:00
btintel.h
btmrvl_debugfs.c
btmrvl_drv.h
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
btqca.c
btqca.h
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
btsdio.c
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
hci_ath.c
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