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

From: Andy Shevchenko

Date: Fri Feb 20 2026 - 09:17:28 EST


On Fri, Feb 20, 2026 at 04:13:35PM +0200, Andy Shevchenko 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.
>
> TL;DR: I am not going to NAK, but patches 1-4 is an unneeded churn to me.

For the record you may look at my patches in the Git history on the same
matter, they do not kill all 'else':s in such cases.

git log --no-merges -p --author="Andy Shevchenko" --grep "redundant 'else'"

--
With Best Regards,
Andy Shevchenko