Skip to contentSkip to conversation

include/linux/irq.h: #include <linux/smp.h>

RFC PATCH In review Adrian Bunk 3 participants 8 messages Dec 21, 2005 IRQ

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 include/linux/irq.h: #include <linux/smp.h>

Jan's crosscompile page [1] shows, that one regression in 2.6.15-rc is that the v850 defconfig does no longer compile.

The compile error is:

<-- snip -->

...
CC arch/v850/kernel/setup.o
In file included from /usr/src/ctest/rc/kernel/arch/v850/kernel/setup.c:17:
/usr/src/ctest/rc/kernel/include/linux/irq.h:13:43: asm/smp.h: No such file or directory make[2]: *** [arch/v850/kernel/setup.o] Error 1

<-- snip -->

The #include <asm/smp.h> in irq.h was intruduced in 2.6.15-rc.

Since include/linux/irq.h needs code from asm/smp.h only in the CONFIG_SMP=y case and linux/smp.h #include's asm/smp.h only in the CONFIG_SMP=y case, I'm suggesting this patch to #include <linux/smp.h> in irq.h.

I've tested the compilation with both CONFIG_SMP=y and CONFIG_SMP=n on i386.

include/linux/irq.h renamed from include/linux/irq.h.old +1 -1
@@ -10,7 +10,7 @@
  */
 
 #include <linux/config.h>
-#include <asm/smp.h>		/* cpu_online_map */
+#include <linux/smp.h>
 
 #if !defined(CONFIG_ARCH_S390)
 
#1 lore raw
Quoted 17 lines · Adrian Bunk

The #include <asm/smp.h> in irq.h was intruduced in 2.6.15-rc.

Since include/linux/irq.h needs code from asm/smp.h only in the CONFIG_SMP=y case and linux/smp.h #include's asm/smp.h only in the CONFIG_SMP=y case, I'm suggesting this patch to #include <linux/smp.h> in irq.h.

I've tested the compilation with both CONFIG_SMP=y and CONFIG_SMP=n on i386.

include/linux/irq.h line 15

Quoted 7 lines
include/linux/irq.h renamed from include/linux/irq.h.old +1 -1
@@ -10,7 +10,7 @@
  */
 
 #include <linux/config.h>
-#include <asm/smp.h>		/* cpu_online_map */
+#include <linux/smp.h>
 
 #if !defined(CONFIG_ARCH_S390)

Yes, it's basically always wrong to include asm/foo.h when linux/foo.h exists.

#2 lore raw
Quoted 2 lines · Andrew Morton

Yes, it's basically always wrong to include asm/foo.h when linux/foo.h exists.

There's always an exception to every rule. linux/irq.h is that exception for the above rule.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
#3 lore raw
Quoted 6 lines · Russell King
Quoted 2 lines · Andrew Morton

Yes, it's basically always wrong to include asm/foo.h when linux/foo.h exists.

There's always an exception to every rule. linux/irq.h is that exception for the above rule.

Why?

Quoted 1 line

Russell King

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

#4 lore raw
Quoted 9 lines · Adrian Bunk
Quoted 6 lines · Russell King
Quoted 2 lines · Andrew Morton

Yes, it's basically always wrong to include asm/foo.h when linux/foo.h exists.

There's always an exception to every rule. linux/irq.h is that exception for the above rule.

Why?

/*
* Please do not include this file in generic code. There is currently
* no requirement for any architecture to implement anything held
* within this file.
*
* Thanks. --rmk
*/

Using linux/irq.h instead of asm/irq.h _breaks_ architectures which do not use the generic irq code.

Basically, linux/irq.h should have been called asm-generic/irq.h.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
#5 lore raw
Quoted 19 lines · Russell King
Quoted 9 lines · Adrian Bunk
Quoted 6 lines · Russell King
Quoted 2 lines · Andrew Morton

Yes, it's basically always wrong to include asm/foo.h when linux/foo.h exists.

There's always an exception to every rule. linux/irq.h is that exception for the above rule.

Why?

/*
* Please do not include this file in generic code. There is currently
* no requirement for any architecture to implement anything held
* within this file.
*
* Thanks. --rmk
*/

Quoted 4 lines

Using linux/irq.h instead of asm/irq.h _breaks_ architectures which do not use the generic irq code.

Basically, linux/irq.h should have been called asm-generic/irq.h.

I'm not getting your point.

The patch we are discussing is:

include/linux/irq.h renamed from include/linux/irq.h.old +1 -1
@@ -10,7 +10,7 @@
  */
 
 #include <linux/config.h>
-#include <asm/smp.h>		/* cpu_online_map */
+#include <linux/smp.h>
 
 
 
Quoted 1 line

Russell King

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#6 lore raw
Quoted 20 lines · Adrian Bunk
Quoted 19 lines · Russell King
Quoted 9 lines · Adrian Bunk
Quoted 6 lines · Russell King
Quoted 2 lines · Andrew Morton

Yes, it's basically always wrong to include asm/foo.h when linux/foo.h exists.

There's always an exception to every rule. linux/irq.h is that exception for the above rule.

Why?

/*
* Please do not include this file in generic code. There is currently
* no requirement for any architecture to implement anything held
* within this file.
*
* Thanks. --rmk
*/

Quoted 6 lines
Quoted 4 lines

Using linux/irq.h instead of asm/irq.h _breaks_ architectures which do not use the generic irq code.

Basically, linux/irq.h should have been called asm-generic/irq.h.

I'm not getting your point.

The point is _exactly_ as the above quotation between Andrew Morton and myself. I'm sure it's not me being thick because it's absolutely damned obvious from the above.

Andrew said: "Yes, it's basically always wrong to include asm/foo.h when linux/foo.h exists."

That statement is a rule. I assert that this is an incorrect statement and I assert that there is a proven case where this statement is incorrect.

Hence, to avoid people reading Andrew's misleading statement, I followed up on precisely _that_ point and _that_ point alone.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
#7 lore raw
Quoted 5 lines · Russell King

The point is _exactly_ as the above quotation between Andrew Morton and myself. I'm sure it's not me being thick because it's absolutely damned obvious from the above.

Quoted 8 lines

Andrew said: "Yes, it's basically always wrong to include asm/foo.h when linux/foo.h exists."

That statement is a rule. I assert that this is an incorrect statement and I assert that there is a proven case where this statement is incorrect.

Hence, to avoid people reading Andrew's misleading statement, I followed up on precisely _that_ point and _that_ point alone.

OK, now I got it:

You are arguing only against Andrew's statement of a general rule, not against my patch.

Sorry for my misunderstading.

Quoted 1 line

Russell King

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed