Re: [PATCH v3] Coccinelle: Script to replace NULL test with IS_ERR test for devm_ioremap_resource

From: Julia Lawall
Date: Sat Aug 06 2016 - 16:03:01 EST




On Sat, 6 Aug 2016, SF Markus Elfring wrote:

> > +@err depends on context || org || report@
> > +statement S;
> > +expression e;
> > +position j0;
>
> How do you think about to omit the number from this variable name?
>
>
> > +@@
> > +
> > + e = devm_ioremap_resource(...);
> > +* if (!e@j0) S
>
> Are there any more functions to consider for such a source code search pattern?
> How do you think about to use a function name list here?

How about getting this into the kernel, and then one can worry about
adding more functions later.

>
> > +// ----------------------------------------------------------------------------
>
> I suggest to omit such comment lines from this SmPL script.

These are introduced by spgen. Likewise for the numbers on the j
variables. The pattern j + number can even be useful, because it shows a
position variable that introduced to manage the different kinds of output,
rather than something that is intrinsic to the computation being
performed.

julia

>
> Regards,
> Markus
>