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

Markus Elfring
2025-07-01T13:01:51Z

> Another SmPL script example:

for further development considerations?

@display@
identifier i;
statement s;
statement list sl;
type t;
@@
(return ...;
|t i;
(
<+...
*s
...+>
|
*sl
)
)

Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> time /usr/bin/spatch --no-loops …/Projekte/Coccinelle/janitor/show_functions_with_more_than_single_return2.cocci include/uapi/linux/usb/ch9.h
…
@@ -668,7 +668,6 @@ usb_endpoint_maxp_mult(const struct usb_
…
@@ -723,17 +722,10 @@ usb_ss_max_streams(const struct usb_ss_e
…
real 0m0,250s
user 0m0,217s
sys 0m0,030s

Regards,
Markus