Re: [PATCH 00/36] treewide: remove conditional returns with no effect
From: Jani Nikula
Date: Mon Jul 27 2026 - 04:37:27 EST
On Fri, 24 Jul 2026, Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
> On Fri, 24 Jul 2026 03:45:02 +0900 Sang-Heon Jeon wrote:
>> Patch 1 adds a Coccinelle script that matches the pattern, including
>> negation and constant-comparison variants. Where a local variable is
>> assigned right before the check, the assignment and the two returns
>> turn into a single return of the assigned expression.
>
> Huh, I thought we already had such script. Various script children have
> been sending such "cleanups" in the past.
We did, and it was removed, I believe in 1a617a8475e8 ("coccinelle:
misc: remove "complex return code" warnings"), because people just don't
want this constant churn.
It's perfectly fine to have the error case and happy day scenario
separated.
BR,
Jani.
--
Jani Nikula, Intel