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

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

From: Joe Perches <joe@perches.com>
Date: 2017-06-16 12:04:47

On Fri, 2017-06-16 at 12:22 +0200, Johannes Berg wrote:
On Fri, 2017-06-16 at 12:16 +0200, Arend van Spriel wrote:
quoted
quoted
     @@
     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?
Indeed, I mean S, will fix.
Perhaps

	skb_put_data(skb, &c, sizeof(c))

as that avoids api expansion.

Optimizing the indirections and the size in a macro front-end
in skb_put_data may be better as it's would be completely
consistent for all use styles.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help