Re: checkpatch.pl warning for "return" with value

From: Joe Perches
Date: Fri Apr 17 2020 - 17:27:21 EST


On Fri, 2020-04-17 at 14:52 -0400, Luben Tuikov wrote:
> Also checking and returning from a function, doesn't
> always have to be binary. It could be,
>
> if (A) {
> ...;
> return X;
> } else if (B) {
> ...;
> return Y;
> } else {
> ...;
> return Z;
> }
> }
>
> And interestingly, checkpatch.pl doesn't complain for
> the triplet above. But if I remove condition B, above,
> it does complain.

My recollection is false positives existed so the
else if case was not wanted.