Skip to contentSkip to conversation

m68k: compile fix - hardirq checks were in wrong place

PATCH In review Al Viro 3 participants 5 messages Dec 15, 2005

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/3 m68k: compile fix - hardirq checks were in wrong place

Move the sanity check for NR_IRQS being no more than 1<<HARDIRQ_BITS from asm-m68k/hardirq.h to asm-m68k/irq.h; needed since NR_IRQS is not necessary know at the points of inclusion of asm/hardirq.h due to the rather ugly header dependencies on m68k. Fix is by far simpler than trying to massage those dependencies...

---

 include/asm-m68k/hardirq.h |    9 ---------
 include/asm-m68k/irq.h     |    9 +++++++++
 2 files changed, 9 insertions(+), 9 deletions(-)

69139a634877359d1bd7b19c2862c9a01468b614

include/asm-m68k/hardirq.h +0 -9
index 728318b..5e1c582 100644
@@ -14,13 +14,4 @@ typedef struct {
 
 #define HARDIRQ_BITS	8
 
-/*
- * The hardirq mask has to be large enough to have
- * space for potentially all IRQ sources in the system
- * nesting on a single CPU:
- */
-#if (1 << HARDIRQ_BITS) < NR_IRQS
-# error HARDIRQ_BITS is too low!
-#endif
-
 #endif
include/asm-m68k/irq.h +9 -0
index 1f56990..d312674 100644
@@ -23,6 +23,15 @@
 #endif
 
 /*
+ * The hardirq mask has to be large enough to have
+ * space for potentially all IRQ sources in the system
+ * nesting on a single CPU:
+ */
+#if (1 << HARDIRQ_BITS) < NR_IRQS
+# error HARDIRQ_BITS is too low!
+#endif
+
+/*
  * Interrupt source definitions
  * General interrupt sources are the level 1-7.
  * Adding an interrupt service routine for one of these sources
Signature · 1 line
0.99.9.GIT
#1 lore raw

Hi,

Quoted 5 lines · Al Viro

Move the sanity check for NR_IRQS being no more than 1<<HARDIRQ_BITS from asm-m68k/hardirq.h to asm-m68k/irq.h; needed since NR_IRQS is not necessary know at the points of inclusion of asm/hardirq.h due to the rather ugly header dependencies on m68k. Fix is by far simpler than trying to massage those dependencies...

I disagree.

Quoted 8 lines
include/asm-m68k/hardirq.h +0 -0
index 728318b..5e1c582 100644
@@ -14,13 +14,4 @@ typedef struct {
 
 #define HARDIRQ_BITS	8
 

include/asm-m68k/hardirq.h typedef struct { · line 17

Quoted 10 lines
include/asm-m68k/hardirq.h +0 -9
-/*
- * The hardirq mask has to be large enough to have
- * space for potentially all IRQ sources in the system
- * nesting on a single CPU:
- */
-#if (1 << HARDIRQ_BITS) < NR_IRQS
-# error HARDIRQ_BITS is too low!
-#endif
-
 #endif

You separate the definition from the check, now you push the responsibility to get the order right to the header users. Sorry, but I prefer to fix the header dependencies than scatter things which belong together over multiple files.

bye, Roman

#2 lore raw
Quoted 4 lines

You separate the definition from the check, now you push the responsibility to get the order right to the header users. Sorry, but I prefer to fix the header dependencies than scatter things which belong together over multiple files.

For 2.6.16 I'll submit a patch to merge asm/irq.h and asm/hardirq.h. Until then this is the much better fix because it doesn't require pointless include reordering all over the tree.

#3 lore raw

Hi,

Quoted 6 lines · Christoph Hellwig
Quoted 4 lines

You separate the definition from the check, now you push the responsibility to get the order right to the header users. Sorry, but I prefer to fix the header dependencies than scatter things which belong together over multiple files.

For 2.6.16 I'll submit a patch to merge asm/irq.h and asm/hardirq.h.

This will likely break m68k header dependencies.

Quoted 2 lines

Until then this is the much better fix because it doesn't require pointless include reordering all over the tree.

In this case I would prefer to leave it as is, as it conflicts with m68k tree and I would prefer to fix the mess only once.

bye, Roman

author
#4 lore raw
In reply to Roman Zippel
Quoted 2 lines · Roman Zippel

You separate the definition from the check, now you push the responsibility to get the order right to the header users.

There are two definitions, one in old place, another in new one. You need both seen before the check. On m68k hardirq.h doesn't pull irq.h; irq.h, OTOH, *does* pull hardirq.h via linux/interrupt.h -> linux/hardirq.h -> asm/hardirq.h. IOW, it's less responsibility, not more.

Moreover, new variant works; old one doesn't. Both are brittle, but the old one is flat-out _broken_. As in, new one works with the actual includes in the tree with no extra changes, old one breaks on a number of existing files in the tree.

How the hell does that push responsibility to header users?