[cocci] Adjustments for first statements from selected function implementations?

Markus Elfring <[email protected]> Wed, 25 Mar 2026 08:18:53 +0100
Newsgroups fr.inria.cocci
Message-ID <[email protected]>
Hello!

A contribution like the following shows how a statement can occasionally be added
to the beginning of a function implementation.

PM: runtime: Mark last busy stamp in pm_request_autosuspend()
2025-06-18
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=18c1fe53d186867243f4cf17f4eef60737a16c4c

Such an adjustment triggers further opportunities for corresponding collateral evolution.
The semantic patch language can help in the determination to some degree
if the mentioned statement is still specified before a call of the known function
at other source code places.
A desire can evolve then to omit repeated statements before more selected function calls.

Usual case distinctions trigger further development challenges.

* How would you prefer to manage function names (for SmPL scripts)?

* Several inline function implementations are also stored in header files.
  Some header files tend to provide contents which are not really supported
  by the Coccinelle software so far.


Would you be looking then for further possibilities with improving affected
data processing?

Regards,
Markus