Re: [v6] coccinelle: semantic code search for missing put_device()

2019-03-06 Thread Markus Elfring
> Do you have any other questions? I would like to point another aspect out for further development considerations. The initial assignment targets are (id)expressions in the discussed analysis approach so far. Would you like to care also for value (or pointer) initialisations by resource

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-19 Thread Markus Elfring
>> Will corrections become relevant for specifications in (assignment) >> exclusions >> of the second SmPL ellipsis in the discussed script? > > Let's do some experiments with the code in the current kernel. It seems that you provided additional information for the adjustment of when

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-19 Thread Markus Elfring
> Do you have any other questions? Obviously, yes. I am curious if this development discussion and code review will trigger further software adjustments. I guess that you will need additional time to reconsider specific items from recent feedback. Will corrections become relevant for

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-19 Thread Markus Elfring
>> Although we have tested these two methods in the existing kernel code, >> considering the evolution of the kernel code, these special cases may occur, >> so we are willing to take them into account. >> We plan to modify the code like this: >> >> id = of_find_device_by_node@p1(x) >> -... when

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-18 Thread Julia Lawall
On Tue, 19 Feb 2019, wen.yan...@zte.com.cn wrote: > > > I would have a hard time saying which one is more reasonable to test, > > I suggest to reconsider the interpretation of this software situation once > > more. > > > since both are extremely unlikely. > > I disagree to this view because

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-18 Thread Markus Elfring
>> Which data element should not get reassigned here (before a corresponding >> null pointer check)? >> > > Thank you for your comments. > We did some experiments: > +id = of_find_device_by_node@p1(x) > +... when != e = id > ... > Or: > ... > + ... when != id = e > > The number of issuses found by

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-18 Thread Markus Elfring
>>> Which data element should not get reassigned here (before a corresponding >>> null pointer check)? >>> >> >> Thank you for your comments. >> We did some experiments: >> +id = of_find_device_by_node@p1(x) >> +... when != e = id >> ... >> Or: >> ... >> + ... when != id = e >> >> The number of

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-17 Thread Julia Lawall
On Mon, 18 Feb 2019, wen.yan...@zte.com.cn wrote: > > > when != e = id achieves this behavior. > > > > I can not agree to this view completely because of the meaning that is > > connected > > with these variable identifiers. > > > > Both metavariables share the kind “expression”. So I can

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-17 Thread Markus Elfring
>> … >> +@search exists@ >> +local idexpression id; >> +expression x,e,e1; >> +position p1,p2; >> … >> +@@ >> + >> +id = of_find_device_by_node@p1(x) >> +... when != e = id >> … >> >> Or: >> >> … >> + ... when != id = e >> … >> >> >> Which SmPL specification will achieve the desired software

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-17 Thread Julia Lawall
On Sun, 17 Feb 2019, Markus Elfring wrote: > >> If you would insist on the specification of such an assignment exclusion > >> for a SmPL ellipsis: > >> Can we agree on a correct order? > > > > I don't get your point. > > I propose to take another closer look at a bit of SmPL code. > > > > There

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-17 Thread Markus Elfring
>> If you would insist on the specification of such an assignment exclusion >> for a SmPL ellipsis: >> Can we agree on a correct order? > > I don't get your point. I propose to take another closer look at a bit of SmPL code. > There is no correct order. I have got an other software development

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-17 Thread Julia Lawall
On Sun, 17 Feb 2019, Markus Elfring wrote: > >> Would you dare to interpret my update suggestion (reordering of two > >> identifiers) > >> as a required SmPL script correction? > > > > I didn't suggest to reorder anything. > > This is obvious according to your acknowledgement for the sixth

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-17 Thread Markus Elfring
>> Would you dare to interpret my update suggestion (reordering of two >> identifiers) >> as a required SmPL script correction? > > I didn't suggest to reorder anything. This is obvious according to your acknowledgement for the sixth version of this evolving SmPL script. > Both are needed. If

Re: [PATCH v6] coccinelle: semantic code search for missing put_device()

2019-02-17 Thread Julia Lawall
On Sun, 17 Feb 2019, Markus Elfring wrote: > >>> +@search exists@ > >>> +local idexpression id; > >>> +expression x,e,e1; > >>> +position p1,p2; > >>> +type T,T1,T2; > >>> +@@ > >>> + > >>> +id = of_find_device_by_node@p1(x) > >>> +... when != e = id > >> > >> I suggest to increase your

Re: [PATCH v6] coccinelle: semantic code search for missing put_device()

2019-02-17 Thread Markus Elfring
>>> +@search exists@ >>> +local idexpression id; >>> +expression x,e,e1; >>> +position p1,p2; >>> +type T,T1,T2; >>> +@@ >>> + >>> +id = of_find_device_by_node@p1(x) >>> +... when != e = id >> >> I suggest to increase your software development attention also for >> another implementation detail.

Re: [PATCH v6] coccinelle: semantic code search for missing put_device()

2019-02-17 Thread Julia Lawall
On Sun, 17 Feb 2019, Markus Elfring wrote: > > +@search exists@ > > +local idexpression id; > > +expression x,e,e1; > > +position p1,p2; > > +type T,T1,T2; > > +@@ > > + > > +id = of_find_device_by_node@p1(x) > > +... when != e = id > > I suggest to increase your software development attention

Re: [PATCH v6] coccinelle: semantic code search for missing put_device()

2019-02-17 Thread Markus Elfring
> +@search exists@ > +local idexpression id; > +expression x,e,e1; > +position p1,p2; > +type T,T1,T2; > +@@ > + > +id = of_find_device_by_node@p1(x) > +... when != e = id I suggest to increase your software development attention also for another implementation detail. Source code analysis

Re: 答复: [v6] coccinelle: semantic code search for missing put_device()

2019-02-16 Thread Markus Elfring
> But please also refer to the examples of coccinelle, such as: > http://coccinelle.lip6.fr/rules/kmalloc.html > and > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/coccinelle/free/pci_free_consistent.cocci These scripts for the semantic patch language show some

Re: [v6] coccinelle: semantic code search for missing put_device()

2019-02-16 Thread Markus Elfring
> In a function, for a local variable obtained by of_find_device_by_node(), I got a software understanding where such a variable can not be obtained from this function call. The return value (like a pointer in this use case) can be stored there. > v6: > - to be double sure, replace >dev with

Re: [PATCH v6] coccinelle: semantic code search for missing put_device()

2019-02-16 Thread Julia Lawall
On Sat, 16 Feb 2019, Wen Yang wrote: > The of_find_device_by_node() takes a reference to the underlying device > structure, we should release that reference. > The implementation of this semantic code search is: > In a function, for a local variable obtained by of_find_device_by_node(), > a,