Re: [PATCH v1 1/1] libnvdimm/labels: Get rid of redundant 'else'

From: Andy Shevchenko

Date: Thu Nov 06 2025 - 02:37:28 EST


On Wed, Nov 05, 2025 at 01:18:46PM -0600, Ira Weiny wrote:
> Andy Shevchenko wrote:
> > In the snippets like the following
> >
> > if (...)
> > return / goto / break / continue ...;
> > else
> > ...
> >
> > the 'else' is redundant. Get rid of it.
>
> What is the reason for this change? This results in 0.6% code size
> reduction. Is that really worth this effort?

You answered to it additionally to my point. The unneeded 'else' makes code harder to read.
Also see indentation level reduction and less LoCs overall.

I sent this patch (not as RFC or so), from my p.o.v. your Q is rhetorical :-)

P.S. I made dozens of patches like this in the past, you are the first one
questioning this, and I am glad to have a discussion started on this matter.

--
With Best Regards,
Andy Shevchenko