Re: [cocci] [PATCH 01/36] coccinelle: misc: add cond_return_no_effect.cocci

From: Markus Elfring

Date: Mon Jul 27 2026 - 06:08:33 EST



> +++ b/scripts/coccinelle/misc/cond_return_no_effect.cocci
> @@ -0,0 +1,121 @@

> +@depends on patch@
> +type T;
> +identifier collect.ret;
> +constant C;
> +@@
> +- T ret = C;
> + ... when != ret
> + when strict


Previous transformation rules can have the effect that some variable definitions
would not be used any more.
Thus such an SmPL rule can look succinct for a possible source code clean-up.

I suggest to take also another look at information according to software
run time characteristics.
Software components are still improvable accordingly which can be seen by bug reports.

Example:
In-place parallelized run on a directory seems to be stuck after 17 hours
https://github.com/coccinelle/coccinelle/issues/416#issuecomment-5080158670

Regards,
Markus