mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH v4] coccinelle: semantic patch for missing put_device()
       [not found] <201902151422261425412@zte.com.cn>
@ 2019-02-15  6:25 ` Julia Lawall
  2019-02-15  7:11   ` [v4] " Markus Elfring
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2019-02-15  6:25 UTC (permalink / raw)
  To: wen.yang99
  Cc: Markus.Elfring, Gilles Muller, nicolas.palix, michal.lkml,
	wang.yi59, yamada.masahiro, yellowriver2010, cheng.shengyu,
	cocci, linux-kernel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1691 bytes --]



On Fri, 15 Feb 2019, wen.yang99@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 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 what Markus is talking about here, so I'm not sure that a
change is needed.

>
> > * Would you like to pick any software development challenges up around
> > inter-procedural data flow (or even escape) analysis for the shown use case?
>
> We are very interested in doing this work, but currently coccinelle may
> not support data flow analysis, and we hope to contribute a little.
>
> > Would you like to add a SPDX identifier?
>
> OK, we will add a SPDX identifierfix soon.
>
> >> + "ERROR: missing put_device;"
> >Will change confidence considerations result in another fine-tuning for this message?
>
> Thank you, we will change "ERROR" to "WARNING".

I think ERROR is fine.  If it is a real positive than it is a real
problem.  Warning is for things that look ugly, but don't have any impact
on the execution.

julia

> >> + + " call of_find_device_by_node on line "
> >I find that such a split string literal can be unwanted.
>
> Thank you, we will fix it soon.
>
> >> + + " and return without releasing.")
> >Possible rewording?
> >+ + " but without a corresponding object release within this function.")
>
> Thanks, we will modify it according to your suggestion.
>
> Regards,
> Wen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [v4] coccinelle: semantic patch for missing put_device()
  2019-02-15  6:25 ` [PATCH v4] coccinelle: semantic patch for missing put_device() Julia Lawall
@ 2019-02-15  7:11   ` Markus Elfring
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2019-02-15  7:11 UTC (permalink / raw)
  To: Julia Lawall, Wen Yang
  Cc: Gilles Muller, Nicolas Palix, Michal Marek, Yi Wang,
	Masahiro Yamada, Wen Yang, Cheng Shengyu, cocci, linux-kernel,
	kernel-janitors

>>>> 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 what Markus is talking about here,

I find that my feedback contained details for two items.

1. I suggested another adjustment for a wording in the evolving
   commit description.

2. Should any more case distinctions be taken into account for the data
   storage of function return values so that the shown source code search
   approach can become safer?


> so I'm not sure that a change is needed.

I am curious if there is a need for further clarifications then.


>>>> + "ERROR: missing put_device;"
>>> Will change confidence considerations result in another fine-tuning for this message?
>>
>> Thank you, we will change "ERROR" to "WARNING".
>
> I think ERROR is fine.

I have got a different software development view for the possible
severity information.


> If it is a real positive than it is a real problem.

I can agree to this information.

You specified also a precondition.
How should be achieved that the source code analysis will not point
false positives out?


> Warning is for things that look ugly,

I am also curious on how views will evolve around such ugliness.


> but don't have any impact on the execution.

I find such a restriction questionable.


Would you like to share any more ideas for safe data flow analysis
(eventually also together with your software)?

Regards,
Markus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [v4] coccinelle: semantic patch for missing put_device()
  2019-02-15  8:02     ` Julia Lawall
@ 2019-02-15  8:19       ` Markus Elfring
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2019-02-15  8:19 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Wen Yang, Gilles Muller, Nicolas Palix, Michal Marek, Yi Wang,
	Masahiro Yamada, Wen Yang, Cheng Shengyu, cocci, linux-kernel,
	kernel-janitors

> 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 processing?


> then someone else will likely take care of calling put_device later
> when the structure is destroyed.

Such a view is reasonable.

Are there any additional source code analysis and software development challenges
to consider for safer resource management?

Regards,
Markus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [v4] coccinelle: semantic patch for missing put_device()
  2019-02-15  7:50   ` [v4] " Markus Elfring
@ 2019-02-15  8:02     ` Julia Lawall
  2019-02-15  8:19       ` Markus Elfring
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2019-02-15  8:02 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Wen Yang, Gilles Muller, Nicolas Palix, Michal Marek, Yi Wang,
	Masahiro Yamada, Wen Yang, Cheng Shengyu, cocci, linux-kernel,
	kernel-janitors



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 case.
>
> I have got understanding difficulties for such information.
> What did you try to express with this sentence finally?

The whole goal of the semantic patch is to ensure that put_device is
called when needed.  If the value is stored in a structure, then someone
else will likely take care of calling put_device later when the structure
is destroyed.

julia

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [v4] coccinelle: semantic patch for missing put_device()
  2019-02-15  6:55 ` [PATCH v4] " Julia Lawall
@ 2019-02-15  7:50   ` Markus Elfring
  2019-02-15  8:02     ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Elfring @ 2019-02-15  7:50 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Wen Yang, Gilles Muller, Nicolas Palix, Michal Marek, Yi Wang,
	Masahiro Yamada, Wen Yang, Cheng Shengyu, cocci, linux-kernel,
	kernel-janitors

>> 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.
What did you try to express with this sentence finally?

Regards,
Markus

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-15  8:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <201902151422261425412@zte.com.cn>
2019-02-15  6:25 ` [PATCH v4] coccinelle: semantic patch for missing put_device() Julia Lawall
2019-02-15  7:11   ` [v4] " Markus Elfring
     [not found] <201902151452197117145@zte.com.cn>
2019-02-15  6:55 ` [PATCH v4] " Julia Lawall
2019-02-15  7:50   ` [v4] " Markus Elfring
2019-02-15  8:02     ` Julia Lawall
2019-02-15  8:19       ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®