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.

johannes

Reply via email to