All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
	Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [IA64] Add mapping table between irq and vector
Date: Fri, 20 Jul 2007 20:21:38 +0000	[thread overview]
Message-ID: <20070720132138.63d8f931.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070720131728.a7335d92.akpm@linux-foundation.org>

On Fri, 20 Jul 2007 13:17:28 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Fri, 20 Jul 2007 19:59:17 GMT
> Linux Kernel Mailing List <linux-kernel@vger.kernel.org> wrote:
> 
> > +	BUG_ON(bind_irq_vector(irq, vector));
> 
> It's not good practice to do assert(expression-with-side-effects).  Because
> if someone wants to create a build which has all the assertions disabled,
> the resulting binary will not work.
> 
> In the present implementation our BUG_ON(expression) will evaluate
> `expression' even if CONFIG_BUG=n.  But that's totally lame and we are just
> leaving optimisation opportunities on the floor.
> 
> Our objective _should_ be to make BUG_ON(expr) generate no code at all if
> CONFIG_BUG=n.
> 
> So please, prefer to do
> 
> 	if (bind_irq_vector(irq, vector))
> 		BUG();
> 

hm, now I think about it, our present implementation seems OK.  If you
have CONFIG_BUG=n then this:

	BUG_ON(foo < bar);

will generate no code and this:

	BUG_ON(some_function());

will still call some_function().

So I guess we're OK.

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
	Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [IA64] Add mapping table between irq and vector
Date: Fri, 20 Jul 2007 13:21:38 -0700	[thread overview]
Message-ID: <20070720132138.63d8f931.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070720131728.a7335d92.akpm@linux-foundation.org>

On Fri, 20 Jul 2007 13:17:28 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Fri, 20 Jul 2007 19:59:17 GMT
> Linux Kernel Mailing List <linux-kernel@vger.kernel.org> wrote:
> 
> > +	BUG_ON(bind_irq_vector(irq, vector));
> 
> It's not good practice to do assert(expression-with-side-effects).  Because
> if someone wants to create a build which has all the assertions disabled,
> the resulting binary will not work.
> 
> In the present implementation our BUG_ON(expression) will evaluate
> `expression' even if CONFIG_BUG=n.  But that's totally lame and we are just
> leaving optimisation opportunities on the floor.
> 
> Our objective _should_ be to make BUG_ON(expr) generate no code at all if
> CONFIG_BUG=n.
> 
> So please, prefer to do
> 
> 	if (bind_irq_vector(irq, vector))
> 		BUG();
> 

hm, now I think about it, our present implementation seems OK.  If you
have CONFIG_BUG=n then this:

	BUG_ON(foo < bar);

will generate no code and this:

	BUG_ON(some_function());

will still call some_function().

So I guess we're OK.

  reply	other threads:[~2007-07-20 20:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200707201959.l6KJxHAu019185@hera.kernel.org>
2007-07-20 20:17 ` [IA64] Add mapping table between irq and vector Andrew Morton
2007-07-20 20:17   ` Andrew Morton
2007-07-20 20:21   ` Andrew Morton [this message]
2007-07-20 20:21     ` Andrew Morton

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=20070720132138.63d8f931.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@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 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.