Skip to contentSkip to conversation

Add mapping table between irq and vector

IA64 Andrew Morton 1 participant 2 messages Jul 20, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Review

Quoted 1 line · On Fri, 20 Jul 2007 19:59:17 GMT Linux Kernel Mailing List…
(quoted diff) +1 -0
+	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();
#2 lore raw
Quoted 13 lines · On Fri, 20 Jul 2007 13:17:28 -0700 Andrew Morton <[email protected]>…

Review

Quoted 1 line · On Fri, 20 Jul 2007 19:59:17 GMT Linux Kernel Mailing List…
(quoted diff) +1 -0
+	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.

Quoted 8 lines

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.