Re: [PATCH v2] coccinelle: semantic code search for missing of_node_put

From: Julia Lawall
Date: Fri Jun 28 2019 - 07:07:55 EST


> > +x = @p1\(of_find_all_nodes\|
>
> I would find this SmPL disjunction easier to read without the usage
> of extra backslashes.
>
> +x =
> +(of_â
> +|of_â
> +)@p1(...);

Did you actually test this? I doubt that a position metavariable can be
put on a ) of a disjunction.

> > +|
> > +return x;
> > +|
> > +return of_fwnode_handle(x);
>
> Can a nested SmPL disjunction be helpful at such places?
>
> +|return
> +(x
> +|of_fwnode_handle(x)
> +);

The original code is much more readable. The internal representation will
be the same.

> > + when != v4l2_async_notifier_add_fwnode_subdev(<...x...>)
>
> Would the specification variant â<+... x ...+>â be relevant
> for the parameter selection?

I'm indeed quite surprised that <...x...> would be accepted by the parser.

julia