/linux/drivers/nfc/nfcmrvl/ |
H A D | fw_dnld.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/net/nfc/ |
H A D | digital_technology.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
H A D | digital_dep.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
H A D | digital_core.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/drivers/bluetooth/ |
H A D | hci_nokia.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
H A D | hci_intel.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
H A D | dtl1_cs.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
H A D | bluecard_cs.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
H A D | bt3c_cs.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/drivers/nfc/st95hf/ |
H A D | core.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/net/nfc/nci/ |
H A D | spi.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
H A D | uart.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
H A D | hci.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/drivers/nfc/microread/ |
H A D | microread.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
H A D | i2c.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/net/nfc/hci/ |
H A D | llc_shdlc.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
H A D | core.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/drivers/net/usb/ |
H A D | zaurus.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
H A D | net1080.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/drivers/nfc/ |
H A D | port100.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/drivers/nfc/fdp/ |
H A D | i2c.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/drivers/nfc/pn533/ |
H A D | pn533.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/drivers/nfc/st21nfca/ |
H A D | i2c.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/drivers/net/hamradio/ |
H A D | scc.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|
/linux/drivers/nfc/pn544/ |
H A D | i2c.c | diff 634fef61076d644b989b86abc2f560d81a089a31 Fri Jun 16 14:29:24 CEST 2017 Johannes Berg <johannes.berg@intel.com> 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>
|