[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1497566309.14396.25.camel@perches.com>
Date: Thu, 15 Jun 2017 15:38:29 -0700
From: Joe Perches <joe@...ches.com>
To: Johannes Berg <johannes@...solutions.net>,
David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] skbuff: make skb_put_zero() return void
On Fri, 2017-06-16 at 00:23 +0200, Johannes Berg wrote:
> On Thu, 2017-06-15 at 15:17 -0700, Joe Perches wrote:
>
> > Here's a script that does the conversion.
> >
> > $ /usr/bin/git grep -P --name-only
> > "\*\s*skb_put\s*\(\s*([\w\.\[\]\>\-]+)\s*,\s*1\s*\)\s*=\s*([^;]+);" |
> > \
> > xargs perl -p -i -e 's/\*\s*skb_put\s*\(\s*([\w\.\[\]\>\-
> > ]+)\s*,\s*1\s*\)\s*=\s*([^;]+);/skb_put_char(\1, \2);/'
>
> Btw, this is incomplete - you have "\*\s*" at the beginning, but there
> are cases like
>
> *(skb_put(skb, 1)) = c;
>
> where you have extra parentheses. By just adding them to the spatch, it
> finds both cases trivially.
>
> I'm much more comfortable using spatch to do things like this.
Knock your self out.
Whatever floats your boat.
Have at it.
Go get 'em.
etc...
There are also some uses like:
memcpy(skb_put(h5->rx_skb, 1), byte, 1);
that could also be converted.
cheers, Joe
Powered by blists - more mailing lists