[Cocci] modifying array initializers?

Johannes Berg johannes at sipsolutions.net
Fri Apr 21 23:24:01 CEST 2017


On Fri, 2017-04-21 at 23:22 +0200, Julia Lawall wrote:

> > @@
> > identifier fn;
> > fresh identifier wrap_fn = "_wrap_" ## fn;
> > @@
> > +static int wrap_fn(struct sk_buff *skb, struct genl_info *info)
> > +{
> > +       return fn(skb, info);
> > +}
> > +
> 
> Use ++ instead.  You may need to put the new function all on one
> line.

Indeed, that works (and yes, I had to put it on a single line)

Thanks!

johannes


More information about the Cocci mailing list