All of lore.kernel.org
 help / color / mirror / Atom feed
From: wsa@the-dreams.de (Wolfram Sang)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Warning masked by BUG() when CONFIG_BUG is enabled
Date: Sun, 17 Nov 2013 15:06:28 +0100	[thread overview]
Message-ID: <20131117140627.GA6744@katana> (raw)
In-Reply-To: <87a9h4559j.fsf@natisbad.org>


> As a side note, I noticed quite some instances of that pattern (switch
> statement w/ a 'default' calling BUG()) while more carefully looking at
> compilation output. I may get slapped for this, but just in case this
> is indeed something which deserves to be fixed and can be fixed
> automagically via some semantic patch, I have CC'ed Coccinelle people.

I don't think this can be fixed in a generic way. This driver, for
example, should IMO return -EINVAL when hitting default in probe and
simply get rid of the other BUG() calls. No need to halt the kernel
because of a broken match->data.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20131117/ec18a9f3/attachment.asc>

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa@the-dreams.de>
To: Arnaud Ebalard <arno@natisbad.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, cocci@systeme.lip6.fr,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [Cocci] Warning masked by BUG() when CONFIG_BUG is enabled
Date: Sun, 17 Nov 2013 15:06:28 +0100	[thread overview]
Message-ID: <20131117140627.GA6744@katana> (raw)
In-Reply-To: <87a9h4559j.fsf@natisbad.org>

[-- Attachment #1: Type: text/plain, Size: 598 bytes --]


> As a side note, I noticed quite some instances of that pattern (switch
> statement w/ a 'default' calling BUG()) while more carefully looking at
> compilation output. I may get slapped for this, but just in case this
> is indeed something which deserves to be fixed and can be fixed
> automagically via some semantic patch, I have CC'ed Coccinelle people.

I don't think this can be fixed in a generic way. This driver, for
example, should IMO return -EINVAL when hitting default in probe and
simply get rid of the other BUG() calls. No need to halt the kernel
because of a broken match->data.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: wsa@the-dreams.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [Cocci] Warning masked by BUG() when CONFIG_BUG is enabled
Date: Sun, 17 Nov 2013 15:06:28 +0100	[thread overview]
Message-ID: <20131117140627.GA6744@katana> (raw)
In-Reply-To: <87a9h4559j.fsf@natisbad.org>


> As a side note, I noticed quite some instances of that pattern (switch
> statement w/ a 'default' calling BUG()) while more carefully looking at
> compilation output. I may get slapped for this, but just in case this
> is indeed something which deserves to be fixed and can be fixed
> automagically via some semantic patch, I have CC'ed Coccinelle people.

I don't think this can be fixed in a generic way. This driver, for
example, should IMO return -EINVAL when hitting default in probe and
simply get rid of the other BUG() calls. No need to halt the kernel
because of a broken match->data.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131117/ec18a9f3/attachment.sig>

  parent reply	other threads:[~2013-11-17 14:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-16 22:52 [Cocci] Warning masked by BUG() when CONFIG_BUG is enabled Arnaud Ebalard
2013-11-16 22:52 ` Arnaud Ebalard
2013-11-16 22:52 ` Arnaud Ebalard
2013-11-17  0:26 ` [Cocci] " Russell King - ARM Linux
2013-11-17  0:26   ` Russell King - ARM Linux
2013-11-17  0:26   ` Russell King - ARM Linux
2013-11-17  0:36   ` [Cocci] " Arnaud Ebalard
2013-11-17  0:36     ` Arnaud Ebalard
2013-11-17  0:36     ` Arnaud Ebalard
2013-11-17 14:06 ` Wolfram Sang [this message]
2013-11-17 14:06   ` [Cocci] " Wolfram Sang
2013-11-17 14:06   ` Wolfram Sang
2013-11-17 14:47   ` Julia Lawall
2013-11-17 14:47     ` Julia Lawall
2013-11-17 14:47     ` Julia Lawall

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=20131117140627.GA6744@katana \
    --to=wsa@the-dreams.de \
    --cc=cocci@systeme.lip6.fr \
    /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.