Re: Coccinelle: Add a SmPL script for the reconsideration of redundant dev_err() calls

From: Julia Lawall
Date: Fri Jun 21 2019 - 10:52:34 EST




On Fri, 21 Jun 2019, Markus Elfring wrote:

> > I still don't see the point of specifying return. Why not just S, where S
> > is a statement metavariable?
>
> Do you find the following SmPL change specification more appropriate?

It looks better.

>
> @deletion depends on patch@
> expression e;
> statement s;
> @@
> e = devm_ioremap_resource(...);
> if (IS_ERR(e))
> (
> -{
> - dev_err(...);
> s
> -}
> |
> {
> <+...
> - dev_err(...);
> ...+>
> }
> )