Re: [PATCH] kernel:signal.c Fix coding style errors and warnings.

From: Al Viro
Date: Sun Nov 16 2014 - 13:01:12 EST


On Sun, Nov 16, 2014 at 07:28:29PM +0200, Ionut Alexa wrote:
> I worked a while in critical automotive software application. There is
> nothing more important than to know your program is running start-to-end in
> the correct order. For the automotive indurstri is safety critical. For PC
> application is not madatory. But for Operating systems, it is a good
> practice. If the function exits from a diferent point depending on some
> conditions, it is hard to debug when the kernel behavior is not the
> expected one.

Excuse me, but this is pure cargo-cult argument. There is a lot more to
complexity of debugging than blind application of rules like that. Sure,
the control flow graph affects it. However, proposed change ("replace
all returns with goto to the end") is not an improvement at all.

There are reasons behind these practices; applying them without understanding
those is not going to work. And the reasons behind the "single exit point
is better" apply to those goto just as well as they did to those return;
control flow remains the same, after all.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/