linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] m68k: compile fix - hardirq checks were in wrong place
@ 2005-12-15  8:54 Al Viro
  2005-12-15 11:58 ` Roman Zippel
  0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2005-12-15  8:54 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, linux-m68k

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...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---

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

69139a634877359d1bd7b19c2862c9a01468b614
diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h
index 728318b..5e1c582 100644
--- a/include/asm-m68k/hardirq.h
+++ b/include/asm-m68k/hardirq.h
@@ -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
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h
index 1f56990..d312674 100644
--- a/include/asm-m68k/irq.h
+++ b/include/asm-m68k/irq.h
@@ -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
-- 
0.99.9.GIT


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] m68k: compile fix - hardirq checks were in wrong place
  2005-12-15  8:54 [PATCH 1/3] m68k: compile fix - hardirq checks were in wrong place Al Viro
@ 2005-12-15 11:58 ` Roman Zippel
  2005-12-15 12:22   ` Christoph Hellwig
  2005-12-15 16:47   ` Al Viro
  0 siblings, 2 replies; 5+ messages in thread
From: Roman Zippel @ 2005-12-15 11:58 UTC (permalink / raw)
  To: Al Viro; +Cc: Linus Torvalds, linux-kernel, linux-m68k

Hi,

On Thu, 15 Dec 2005, Al Viro wrote:

> 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.

> diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h
> index 728318b..5e1c582 100644
> --- a/include/asm-m68k/hardirq.h
> +++ b/include/asm-m68k/hardirq.h
> @@ -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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] m68k: compile fix - hardirq checks were in wrong place
  2005-12-15 11:58 ` Roman Zippel
@ 2005-12-15 12:22   ` Christoph Hellwig
  2005-12-15 12:33     ` Roman Zippel
  2005-12-15 16:47   ` Al Viro
  1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2005-12-15 12:22 UTC (permalink / raw)
  To: Roman Zippel; +Cc: Al Viro, Linus Torvalds, linux-kernel, linux-m68k

> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] m68k: compile fix - hardirq checks were in wrong place
  2005-12-15 12:22   ` Christoph Hellwig
@ 2005-12-15 12:33     ` Roman Zippel
  0 siblings, 0 replies; 5+ messages in thread
From: Roman Zippel @ 2005-12-15 12:33 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Al Viro, Linus Torvalds, linux-kernel, linux-m68k

Hi,

On Thu, 15 Dec 2005, Christoph Hellwig wrote:

> > 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.

> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] m68k: compile fix - hardirq checks were in wrong place
  2005-12-15 11:58 ` Roman Zippel
  2005-12-15 12:22   ` Christoph Hellwig
@ 2005-12-15 16:47   ` Al Viro
  1 sibling, 0 replies; 5+ messages in thread
From: Al Viro @ 2005-12-15 16:47 UTC (permalink / raw)
  To: Roman Zippel; +Cc: Linus Torvalds, linux-kernel, linux-m68k

On Thu, Dec 15, 2005 at 12:58:12PM +0100, Roman Zippel wrote:
> 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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-12-15 16:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-15  8:54 [PATCH 1/3] m68k: compile fix - hardirq checks were in wrong place Al Viro
2005-12-15 11:58 ` Roman Zippel
2005-12-15 12:22   ` Christoph Hellwig
2005-12-15 12:33     ` Roman Zippel
2005-12-15 16:47   ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).