Re: [PATCH] Replaces two GOTO statements with one IF_ELSE statement in /fs/open.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Tue, 21 Jun 2005, Martin Waitz wrote:
> 
> On Mon, Jun 20, 2005 at 01:38:00PM -0700, Andrew Morton wrote:
> > Yes, it is cleaner that way.
> 
> Well, I don't think so...
> 
> > The old trick to make the error-handling code out-of-line shouldn't be
> > needed nowadays - IS_ERR uses unlikely(), which is supposed to handle that
> > stuff.
> 
> IMHO out-of-line error handling improves readability because you have a
> clear boundary between real functionality and error handling.  If both
> are mixed up you have to look longer at the code to understand the
> control-flow.

I personally tend to prefer out-of-line error handling when there are 
multiple error paths, or the function is even slightly more complex. 

In this case the in-line error handling seems warranted, though. Doing it 
out-of-line just doesn't buy you anything in this case.

		Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux