From: Joe Perches <joe@perches.com>
To: Johannes Berg <johannes@sipsolutions.net>,
Arend van Spriel <arend.vanspriel@broadcom.com>,
linux-wireless@vger.kernel.org
Subject: Re: [RFC] networking: add and use skb_put_u8()
Date: Fri, 16 Jun 2017 05:04:44 -0700 [thread overview]
Message-ID: <1497614684.10546.9.camel@perches.com> (raw)
In-Reply-To: <1497608566.2622.7.camel@sipsolutions.net>
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:
> >
> > > @@
> > > 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.
next prev parent reply other threads:[~2017-06-16 12:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-16 9:03 [RFC] networking: add and use skb_put_u8() Johannes Berg
2017-06-16 10:16 ` Arend van Spriel
2017-06-16 10:22 ` Johannes Berg
2017-06-16 12:04 ` Joe Perches [this message]
2017-06-16 12:26 ` Johannes Berg
2017-06-16 12:42 ` Joe Perches
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=1497614684.10546.9.camel@perches.com \
--to=joe@perches.com \
--cc=arend.vanspriel@broadcom.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).