mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Martin Waitz <tali@admingilde.org>
Cc: Andrew Morton <akpm@osdl.org>,
	Christoph Lameter <christoph@lameter.com>,
	jgarzik@pobox.com, telendiz@eircom.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Replaces two GOTO statements with one IF_ELSE statement in /fs/open.c
Date: Tue, 21 Jun 2005 09:05:36 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0506210904040.2268@ppc970.osdl.org> (raw)
In-Reply-To: <20050621085740.GK11059@admingilde.org>



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

  reply	other threads:[~2005-06-21 16:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-20 18:18 Telemaque Ndizihiwe
2005-06-20 18:43 ` Jeff Garzik
2005-06-20 18:54   ` Christoph Lameter
2005-06-20 19:51     ` Joel Schopp
2005-06-20 20:38     ` Andrew Morton
2005-06-21  8:57       ` Martin Waitz
2005-06-21 16:05         ` Linus Torvalds [this message]
2005-06-20 19:07 ` Richard B. Johnson
2005-06-20 20:34   ` Mitchell Blank Jr
2005-06-20 22:06 ` Bill Davidsen
     [not found] <Pine.LNX.4.62.0506201834460.5008@localhost.localdomain.suse.lists.linux.kernel>
     [not found] ` <42B70E62.5070704@pobox.com.suse.lists.linux.kernel>
     [not found]   ` <Pine.LNX.4.62.0506201154300.2245@graphe.net.suse.lists.linux.kernel>
     [not found]     ` <20050620133800.0dac1d97.akpm@osdl.org.suse.lists.linux.kernel>
2005-06-21 11:27       ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0506210904040.2268@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --cc=akpm@osdl.org \
    --cc=christoph@lameter.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tali@admingilde.org \
    --cc=telendiz@eircom.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®