[cocci] Searching function implementations with more than a single return?

Markus Elfring
2025-07-01T08:01:30Z

Hello,

May I expect that a function like usb_ss_max_streams() can be found with the help
of the following source code search pattern?
https://elixir.bootlin.com/linux/v6.16-rc3/source/include/uapi/linux/usb/ch9.h#L721-L737

Another SmPL script example:
@display@
statement list sl;
identifier i;
type t;
@@
(return ...;
|
?t i;
*sl
)

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

Regards,
Markus