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

Julia Lawall
2025-07-01T13:40:42Z

[-- Attachment #1: Type: text/plain, Size: 825 bytes --]

On Tue, 1 Jul 2025, Markus Elfring wrote:

> > Another SmPL script example:
>
> for further development considerations?
>
> @display@
> identifier i;
> statement s;
> statement list sl;
> type t;
> @@
> (return ...;
> |t i;
> (
> <+...
> *s
> ...+>
> |
> *sl
> )
> )

This one makes no sense, because return and t i; can't match the same
thing. So the disjunction has no impact.

julia

>
>
> 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
>