Re: [v4] coccinelle: semantic patch for missing put_device()

2019-02-15 Thread Markus Elfring
> The whole goal of the semantic patch is to ensure that put_device is > called when needed. Thanks for this clarification. The software development goal seems to be clear to some degree. > If the value is stored in a structure, Will any further means become relevant for the discussed data pro

Re: [v4] coccinelle: semantic patch for missing put_device()

2019-02-15 Thread Julia Lawall
On Fri, 15 Feb 2019, Markus Elfring wrote: > >> So I plan to modify the following to capture both cases: > >> -local idexpression id; > >> +expression id; > > > > I'm not sure that this is a good idea. > > Why have you got doubts here? > > > > There is likely no need for a put in the latter cas

Re: [v4] coccinelle: semantic patch for missing put_device()

2019-02-14 Thread Markus Elfring
>> So I plan to modify the following to capture both cases: >> -local idexpression id; >> +expression id; > > I'm not sure that this is a good idea. Why have you got doubts here? > There is likely no need for a put in the latter case. I have got understanding difficulties for such information.

Re: [v4] coccinelle: semantic patch for missing put_device()

2019-02-14 Thread Markus Elfring
In a function, for variables returned by calling of_find_device_by_node(), >>> Do variables really get returned? >>> The provided pointer should usually be stored somewhere. >> >> Thank you very much, we will consider this situation and submit a next >> version to fix it. > > I don't know wh

Re: [PATCH v4] coccinelle: semantic patch for missing put_device()

2019-02-14 Thread Julia Lawall
On Fri, 15 Feb 2019, wen.yan...@zte.com.cn wrote: > Hi Julia, thank you very much. > > > > >> In a function, for variables returned by calling > > > >> of_find_device_by_node(), > > > > Do variables really get returned? > > > > The provided pointer should usually be stored somewhere. > > > > >

Re: [PATCH v4] coccinelle: semantic patch for missing put_device()

2019-02-14 Thread Julia Lawall
On Fri, 15 Feb 2019, wen.yan...@zte.com.cn wrote: > > How do you think about to exchange the word “patch” by “code search” > > at affected places (and in the subject) then? > > Thanks, we‘ll fix it. > > >> In a function, for variables returned by calling of_find_device_by_node(), > > Do variable

Re: [PATCH v4] coccinelle: semantic patch for missing put_device()

2019-02-14 Thread Markus Elfring
> The implementation of this semantic patch is: Thanks for your extension of such a commit message. I would interpret the provided SmPL code in the way that it will not generate adjusted (patched) C code so far. Source code search results will be presented by the operation mode “report” or “org

[PATCH v4] coccinelle: semantic patch for missing put_device()

2019-02-13 Thread Wen Yang
The of_find_device_by_node() takes a reference to the underlying device structure, we should release that reference. The implementation of this semantic patch is: In a function, for variables returned by calling of_find_device_by_node(), a, if it is released by a function such as put_device()/of