Thread (11 messages) flat view 11 messages, 3 authors, 2017-06-16

Re: [RFC 1/3] networking: make skb_put & friends return void pointers

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2017-06-16 08:42:59

On Fri, 2017-06-16 at 09:53 +0200, Bjørn Mork wrote:
There seem to be a large number of places where the char pointer was
used directly. Not that I have any strong opinion either way, but
adding lots of ugly casts like this seems to contradict the whole
purpose of this change?:
quoted
-			*skb_put(info->rx_skb, 1) = x;
+			*(u8 *)skb_put(info->rx_skb, 1) = x;
 			inb(iobase + DATA_H);
 			info->rx_count--;
 
That does not look any better in my eyes, and there are ... what?
... hundreds of them?
Yeah it's a bit of a trade-off. There are ~140 of these, but >200 of
the removed casts. Joe also suggested we could replace these by
skb_put_u8() or so, which would be indeed be nicer. I can send a patch,
it's pretty simple.

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