Re: [Cocci] Checking redundant variable initialisations with SmPL?

2019-06-21 Thread Julia Lawall
On Thu, 20 Jun 2019, Markus Elfring wrote: > Hello, > > A patch on a topic like “[next] lkdtm: remove redundant initialization of ret” > caught also my software development attention. > https://lkml.org/lkml/2019/6/14/265 > https://lore.kernel.org/patchwork/patch/1088971/ > https://lore.kernel.o

[Cocci] Moving exception handling code to the end of a function implementation with SmPL?

2019-06-21 Thread Markus Elfring
Hello, I became interested in another source code transformation again. I would like to move a bit of common code to the end of a function implementation with the help of the following script for the semantic patch language. @replacement@ expression info, result; identifier target, work; type t

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

2019-06-21 Thread Julia Lawall
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;

Re: [PATCH v2 09/29] docs: driver-model: convert docs to ReST and rename to *.rst

2019-06-21 Thread Greg Kroah-Hartman
On Tue, Jun 18, 2019 at 05:53:27PM -0300, Mauro Carvalho Chehab wrote: > Convert the various documents at the driver-model, preparing > them to be part of the driver-api book. > > The conversion is actually: > - add blank lines and identation in order to identify paragraphs; > - fix tables mar

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

2019-06-21 Thread Markus Elfring
> 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? @deletion depends on patch@ expression e; statement s; @@ e = devm_ioremap_resource(...); if (IS_ERR(e)) ( -{ - dev

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

2019-06-21 Thread Markus Elfring
> 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? @deletion depends on patch@ expression e; statement s; @@ e = devm_ioremap_resource(...); if (IS_ERR(e)) ( -{ - dev

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

2019-06-21 Thread Julia Lawall
On Fri, 21 Jun 2019, Markus Elfring wrote: > > I think that something like > > > > if (IS_ERR(e)) > > { > > <+... > > *dev_err(...) > > ...+> > > } > > > > would be more appropriate. Whether there is a return or not doesn't > > really matter. > > Do you find the following SmPL change specifica

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

2019-06-21 Thread Markus Elfring
> I think that something like > > if (IS_ERR(e)) > { > <+... > *dev_err(...) > ...+> > } > > would be more appropriate. Whether there is a return or not doesn't > really matter. Do you find the following SmPL change specification useful and acceptable? @deletion depends on patch@ expression e;