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

Reply via email to