From: Boaz Harrosh <bharrosh@panasas.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Greg KH <greg@kroah.com>, linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: transport_class: BUG if we can't release the attribute container
Date: Wed, 02 Apr 2008 17:32:46 +0300 [thread overview]
Message-ID: <47F3990E.1010002@panasas.com> (raw)
In-Reply-To: <1207145753.3082.7.camel@localhost.localdomain>
James Bottomley wrote:
<snip>
> Well, we can agree to differ on this. The camp that wants no side
> effects for BUG_ON() does so in case they want to define it to be a nop.
> I've always argued that having special rules for this that differ from
> functions is asking for trouble. It's also easy to preserve the side
> effects by making the compile out do this:
>
> #define BUG_ON(x) (void)(x)
>
> That lets the compiler process the side effects and discard the result.
> This basically means the rules for BUG_ON() arguments are identical to
> the rules for function arguments ... I think that's consonant with the
> principle of least surprise.
>
The Kernel seems to agree with you:
#define BUG_ON(condition) do { if (condition) ; } while(0)
what should we do with stuff like
BUG_ON(check_foo_valid());
which is time consuming and should not run on production machines
should we directly use:
#ifdef CONFIG_BUG
or is there some other facility for that?
Boaz
next prev parent reply other threads:[~2008-04-02 14:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-22 16:39 transport_class: BUG if we can't release the attribute container James Bottomley
2008-04-02 6:32 ` Greg KH
2008-04-02 14:15 ` James Bottomley
2008-04-02 14:30 ` Matthew Wilcox
2008-04-02 14:32 ` James Bottomley
2008-04-02 14:53 ` Greg KH
2008-04-02 15:05 ` James Bottomley
2008-04-02 14:32 ` Boaz Harrosh [this message]
2008-04-02 14:36 ` James Bottomley
2008-04-02 14:54 ` Greg KH
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=47F3990E.1010002@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=greg@kroah.com \
--cc=linux-scsi@vger.kernel.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