All of lore.kernel.org
 help / color / mirror / Atom feed
From: "L. Alberto Giménez" <agimenez@sysvalve.es>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Subject: Re: [PATCH] checkpatch.pl: Add warning for harmful goto labels
Date: Sat, 21 Mar 2015 23:06:56 +0100	[thread overview]
Message-ID: <20150321220655.GA14583@bart.evergreen.loc> (raw)
In-Reply-To: <CAFLxGvy7mYEPm5RYCLk1Cmr=oxzaZqoQS3niKXPk65Cyu4RFkg@mail.gmail.com>

On Sat, Mar 21, 2015 at 10:40:46PM +0100, Richard Weinberger wrote:
> Huh? Since when?

There are a lot of cases where a too generic goto label for cleanup
causes a bug or makes debugging harder.

Last time was this G+ post, by Dan Carpenter:

https://plus.google.com/106378716002406849458/posts/DfuAkt8szf2


> rw@azrael:~/linux (for-v4.1/uml_misc $)> git grep -e "goto out;" | wc -l
> 26667
> rw@azrael:~/linux (for-v4.1/uml_misc $)> git grep -e "goto fail;" | wc -l
> 3733

If something is already in the kernel code, does that mean that it's OK?
I honestly don't think so, and I think that goto labels for cleanup exit
paths should be a little more descriptive.

> What is next? Variable name "i" considered harmful?

No one complained about that so far. I might add that to checkpatch.pl
if needed.

> Can we please stop this nonsense.

It's just a proposal for a warning. If it is really not needed, it won't
be applied and life will go on :)

-- 
L. Alberto Giménez
GnuPG key ID 0xDD4E27AB

  reply	other threads:[~2015-03-21 22:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-21 21:16 [PATCH] checkpatch.pl: Add warning for harmful goto labels L. Alberto Giménez
2015-03-21 21:40 ` Richard Weinberger
2015-03-21 22:06   ` L. Alberto Giménez [this message]
2015-03-21 22:12     ` Richard Weinberger
2015-03-22  2:56       ` Joe Perches
2015-03-22 12:16         ` L. Alberto Giménez
2015-03-21 21:41 ` Peter Hurley
2015-03-21 22:09   ` L. Alberto Giménez

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=20150321220655.GA14583@bart.evergreen.loc \
    --to=agimenez@sysvalve.es \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.weinberger@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.