* [cocci] Searching for function calls with known parameters (by SmPL)?
@ 2026-03-25 8:48 Markus Elfring
2026-03-25 8:52 ` Julia Lawall
0 siblings, 1 reply; 5+ messages in thread
From: Markus Elfring @ 2026-03-25 8:48 UTC (permalink / raw)
To: cocci
Hello!
A function like pm_request_autosuspend() has got the property that it needs
a single input parameter.
https://elixir.bootlin.com/linux/v7.0-rc5/source/include/linux/pm_runtime.h#L460-L483
Such an implementation detail can be easily determined also by the means of
the semantic patch language.
I imagine that corresponding data processing would become more challenging
if it should be determined that a varying number of parameters would be passed
to other function calls at the beginning.
Can function calls be restricted to known parameters accordingly?
Regards,
Markus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [cocci] Searching for function calls with known parameters (by SmPL)?
2026-03-25 8:48 [cocci] Searching for function calls with known parameters (by SmPL)? Markus Elfring
@ 2026-03-25 8:52 ` Julia Lawall
2026-03-25 9:15 ` Markus Elfring
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Julia Lawall @ 2026-03-25 8:52 UTC (permalink / raw)
To: Markus Elfring; +Cc: cocci
On Wed, 25 Mar 2026, Markus Elfring wrote:
> Hello!
>
> A function like pm_request_autosuspend() has got the property that it needs
> a single input parameter.
> https://elixir.bootlin.com/linux/v7.0-rc5/source/include/linux/pm_runtime.h#L460-L483
>
> Such an implementation detail can be easily determined also by the means of
> the semantic patch language.
> I imagine that corresponding data processing would become more challenging
> if it should be determined that a varying number of parameters would be passed
> to other function calls at the beginning.
> Can function calls be restricted to known parameters accordingly?
I still have no idea what you are asking about. What is the connection
between a function call being placed at the beginning of a function and
the number of parameters that that function call requires?
julia
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [cocci] Searching for function calls with known parameters (by SmPL)?
2026-03-25 8:52 ` Julia Lawall
@ 2026-03-25 9:15 ` Markus Elfring
2026-03-25 12:24 ` Markus Elfring
2026-03-26 8:30 ` Markus Elfring
2 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2026-03-25 9:15 UTC (permalink / raw)
To: Julia Lawall; +Cc: cocci
>> Can function calls be restricted to known parameters accordingly?
>
> I still have no idea what you are asking about.
???
> What is the connection
> between a function call being placed at the beginning of a function and
It is usual that a function call can occur at the beginning of a function implementation.
Such a call can occasionally be also repeated before an other call of
the referenced function.
> the number of parameters that that function call requires?
The function signature contains a parameter list.
Would you become interested to determine how many of such parameters
would be passed to a selected function call?
Regards,
Markus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [cocci] Searching for function calls with known parameters (by SmPL)?
2026-03-25 8:52 ` Julia Lawall
2026-03-25 9:15 ` Markus Elfring
@ 2026-03-25 12:24 ` Markus Elfring
2026-03-26 8:30 ` Markus Elfring
2 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2026-03-25 12:24 UTC (permalink / raw)
To: Julia Lawall, cocci
> I still have no idea what you are asking about. What is the connection
> between a function call being placed at the beginning of a function and
> the number of parameters that that function call requires?
Do you see possibilities to extend an SmPL script (like the following)?
@display@
identifier call, input, name;
type t;
@@
name(t* input)
{
*call(input);
...
}
Regards,
Markus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [cocci] Searching for function calls with known parameters (by SmPL)?
2026-03-25 8:52 ` Julia Lawall
2026-03-25 9:15 ` Markus Elfring
2026-03-25 12:24 ` Markus Elfring
@ 2026-03-26 8:30 ` Markus Elfring
2 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2026-03-26 8:30 UTC (permalink / raw)
To: Julia Lawall, cocci
>> Can function calls be restricted to known parameters accordingly?
>
> I still have no idea what you are asking about.
I hope that communication difficulties can be adjusted also with help of
further (software) users.
> What is the connection
> between a function call being placed at the beginning of a function and
> the number of parameters that that function call requires?
I hope also that another description approach can influence evolution
in more desirable directions.
Various functions were designed in the way that they handle parameters.
https://cppreference.com/w/c/language/function_definition.html
The Coccinelle software supports the metavariable type “parameter list”
to some degree.
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/233b5ceb1d5a701fb270ebdf0a9bd6be0a6ce53b/docs/manual/cocci_syntax.tex#L233
Such lists support “special cases” accordingly.
* They can be empty.
Would you like to exclude this case occasionally?
* More than one entry would be provided.
The list length can become more interesting then.
It can occasionally be nice that parameters would explicitly be restricted to
a fixed number of items by the means of the semantic patch language.
Data would be assigned to multiple parameters.
But it is not directly known by this programming interface
in which order they get passed to a function call.
The passed data can be handled by the metavariable type “expression list”.
There are some development challenges remaining for the mapping of contents
with the mentioned metavariable types.
Which expressions would refer to identifiers from a specified parameter list?
Regards,
Markus
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-26 8:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-25 8:48 [cocci] Searching for function calls with known parameters (by SmPL)? Markus Elfring
2026-03-25 8:52 ` Julia Lawall
2026-03-25 9:15 ` Markus Elfring
2026-03-25 12:24 ` Markus Elfring
2026-03-26 8:30 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox