From: Joe Perches <joe@perches.com>
To: "Johannes Berg" <johannes@sipsolutions.net>,
"Bjørn Mork" <bjorn@mork.no>
Cc: netdev@vger.kernel.org
Subject: Re: [RFC 1/3] networking: make skb_put & friends return void pointers
Date: Fri, 16 Jun 2017 03:39:18 -0700 [thread overview]
Message-ID: <1497609558.10546.5.camel@perches.com> (raw)
In-Reply-To: <1497602577.2622.5.camel@sipsolutions.net>
On Fri, 2017-06-16 at 10:42 +0200, Johannes Berg wrote:
> 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?:
> > > - *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.
I would suggest avoiding using skb_put_u8 as it
would suggest there should be skb_put_u16 etc
next prev parent reply other threads:[~2017-06-16 10:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-15 22:12 [RFC 0/3] make skb accessors return void pointers Johannes Berg
2017-06-15 22:12 ` [RFC 1/3] networking: make skb_put & friends " Johannes Berg
2017-06-16 7:53 ` Bjørn Mork
2017-06-16 8:42 ` Johannes Berg
2017-06-16 10:39 ` Joe Perches [this message]
2017-06-16 11:03 ` Johannes Berg
2017-06-16 11:26 ` Joe Perches
2017-06-15 22:12 ` [RFC 2/3] networking: make skb_pull " Johannes Berg
2017-06-15 22:12 ` [RFC 3/3] networking: make skb_push & __skb_push " Johannes Berg
2017-06-16 9:19 ` Joe Perches
2017-06-16 9:24 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1497609558.10546.5.camel@perches.com \
--to=joe@perches.com \
--cc=bjorn@mork.no \
--cc=johannes@sipsolutions.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.