Thread (6 messages) 6 messages, 3 authors, 2017-06-16

Re: [RFC] networking: add and use skb_put_u8()

From: Arend van Spriel <arend.vanspriel@broadcom.com>
Date: 2017-06-16 10:16:59


On 6/16/2017 11:03 AM, Johannes Berg wrote:
From: Johannes Berg <redacted>

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 "C", the spatch isn't perfect, it should
have checked that C is 1, but there's also places that use a
Don't you mean "S" here?

Regards,
Arend
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help