netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: julia.lawall@lip6.fr, joe@perches.com,
	stephen@networkplumber.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: remove unnecessary return's
Date: Fri, 14 Feb 2014 13:48:03 -0500	[thread overview]
Message-ID: <20140214184803.GA16115@redhat.com> (raw)
In-Reply-To: <20140214.134137.2289581685154413307.davem@davemloft.net>

On Fri, Feb 14, 2014 at 01:41:37PM -0500, David Miller wrote:
 > From: Julia Lawall <julia.lawall@lip6.fr>
 > Date: Fri, 14 Feb 2014 10:58:00 +0100 (CET)
 > 
 > > On Thu, 13 Feb 2014, David Miller wrote:
 > > 
 > >> I think it is valuable, it's so much easier to audit the return paths
 > >> via a process of elimination with that kind of layout.  A return in
 > >> the middle of that looks out of place at best.
 > > 
 > > Actually, I had a student who made a tool that went the other way around,
 > > and introduced goto labels for sharable error handling code.  We didn't
 > > get around to using it to send patches, though.  In that tool, we didn't
 > > create labels just for returns, with the thought that in that case there
 > > was no point to introduce a goto if there was nothing to share.
 > 
 > That's one perspective.
 > 
 > But think of it this way, if there is a seqeuence of labels already and
 > you're scanning for a large body of code for control transfers during
 > an audit, what are your eyes more likely to miss?
 > 
 > A sequence goto statements targetting well named and distinct labels
 > or that "return" hidding there somewhere in the middle?

No argument about 'in the middle', but the suggestion upthread was for
the very first case before there are any allocations etc that need unwinding.

	Dave

  reply	other threads:[~2014-02-14 18:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13  4:51 [PATCH net-next] net: remove unnecessary return's Stephen Hemminger
2014-02-13  6:32 ` Joe Perches
2014-02-13 16:02   ` Stephen Hemminger
2014-02-13 21:55   ` Julia Lawall
2014-02-13 22:00     ` Dave Jones
2014-02-13 22:06       ` Julia Lawall
2014-02-13 22:28       ` Julia Lawall
2014-02-13 23:14         ` David Miller
2014-02-14  9:58           ` Julia Lawall
2014-02-14 18:41             ` David Miller
2014-02-14 18:48               ` Dave Jones [this message]
2014-02-13 23:33 ` David Miller

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=20140214184803.GA16115@redhat.com \
    --to=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=joe@perches.com \
    --cc=julia.lawall@lip6.fr \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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;
as well as URLs for NNTP newsgroup(s).