Re: [cocci] Searching function implementations with variable declarations and statements?

Markus Elfring
2025-07-01T12:00:38Z

> May I expect that a function like usb_ss_max_streams() can be found with the help
> of the following source code search pattern?

Another SmPL script example:
@display3@
statement list sl;
identifier i;
type t;
@@
<+...
t i;
...+>
*sl

Should any diff output be produced accordingly?

Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> time /usr/bin/spatch --no-loops …/Projekte/Coccinelle/janitor/show_statements_after_variable_declaration.cocci include/uapi/linux/usb/ch9.h
…
real 0m0,118s
user 0m0,094s
sys 0m0,025s

Regards,
Markus