m68k: compile fix - hardirq checks were in wrong place
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
@@ -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
@@ -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
Hi,
Quoted 5 lines · Al Viro
Move the sanity check for
NR_IRQSbeing no more than 1<<HARDIRQ_BITS fromasm-m68k/hardirq.htoasm-m68k/irq.h; needed sinceNR_IRQSis not necessary know at the points of inclusion ofasm/hardirq.hdue 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@@ -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
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.
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.handasm/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
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?