Re: Coccinelle: semantic patch for missing of_node_put

From: Markus Elfring
Date: Thu May 09 2019 - 04:12:45 EST


> It's interesting to get the function list automatically.

I occasionally imported code data into list variables
or even database tables.


> I'll try to parse the drivers/of/base.c file based on comments like this
> "* Returns a node pointer with refcount incremented, use
> * of_node_put() on it when done."
> to automatically get the name of the function that needs to be checked.

Will feature requests like the following become more interesting?

* Advanced data processing for source code comments
https://github.com/coccinelle/coccinelle/issues/57

* Add a metavariable for the handling of source code
https://github.com/coccinelle/coccinelle/issues/140


> We will continue to analyze the code of coccinelle

How will the understanding evolve for the OCaml source code
of this software?


> to confirm whether this false positive is a bug in coccinelle.

I am also curious on how the corresponding clarification will be continued.

By the way:
Yesterday I stumbled on another questionable software behaviour
while trying to apply an update suggestion from our development discussion
on the topic â[v6] coccinelle: semantic code search for missing put_device()â.
https://lore.kernel.org/cocci/201902191014156680299@xxxxxxxxxx/
https://systeme.lip6.fr/pipermail/cocci/2019-February/005620.html


> But this statement is currently needed here.

Will the need be reconsidered?


I got another development concern here:
You propose to use a SmPL conjunction in the rule âr1â.
How does it fit to the previous exclusion specification âwhen != of_node_put(x)â?

Regards,
Markus