Re: [PATCH 0/5] iio: remove redundant else after return

From: Jonathan Cameron

Date: Sun Feb 22 2026 - 11:44:14 EST


On Fri, 20 Feb 2026 16:13:30 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:

> On Fri, Feb 20, 2026 at 03:33:29PM +0200, Antoniu Miclaus wrote:
> > Remove redundant else branches after return statements across several
> > IIO drivers (ad7298, ad7606, ad5592r, ad5758, admv8818) to simplify
> > control flow.
>
> While technically you are correct, the only patch 5 makes sense to me.
> The rest might be better with 'else' be present. It depends on the logic
> between the lines, if they are of the same semantics and it's not about
> returning error code vs. 0 (success), it may be better to read them
> if they are started on the same column.

I agree. When it's a choice between two 'good' paths and the author
felt if / else made that choice aspect clear than I've always taken the
view that that is reasonable.

So I've picked up patch 5 but not the others. 5 was a little stronger as
it's if (A) do something else do nothing.

>
> TL;DR: I am not going to NAK, but patches 1-4 is an unneeded churn to me.
>