Skip to contentSkip to conversation

Fix missing include

PATCH In review Thomas Gleixner 3 participants 4 messages May 21, 2007 – May 22, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix missing include

ftp://firstfloor.org/pub/ak/x86_64/quilt/x86_64-2.6.22-rc2-070521-1.bz2

explodes in various places due to missing defines of __cold. We can't rely on the assumption that linux/compiler.h is included magically before bug.h is included. Include it explicitely.

include/asm-i386/bug.h +3 -0
Index: linux-2.6.22-rc2-ak/include/asm-i386/bug.h
===================================================================
@@ -8,6 +8,9 @@
  */
 
 #ifdef CONFIG_BUG
+
+#include <linux/compiler.h>
+
 #define HAVE_ARCH_BUG
 
 #ifdef CONFIG_DEBUG_BUGVERBOSE
include/asm-x86_64/bug.h +3 -0
Index: linux-2.6.22-rc2-ak/include/asm-x86_64/bug.h
===================================================================
@@ -2,6 +2,9 @@
 #define __ASM_X8664_BUG_H 1
 
 #ifdef CONFIG_BUG
+
+#include <linux/compiler.h>
+
 #define HAVE_ARCH_BUG
 
 #ifdef CONFIG_DEBUG_BUGVERBOSE
#1 lore raw
Quoted 5 lines · Thomas Gleixner

ftp://firstfloor.org/pub/ak/x86_64/quilt/x86_64-2.6.22-rc2-070521-1.bz2

explodes in various places due to missing defines of __cold. We can't rely on the assumption that linux/compiler.h is included magically before bug.h is included. Include it explicitely.

Hmm, somehow it worked here. Perhaps longer term it would be a good idea to turn compiler.h into an -include

Quoted 1 line

Added thanks

-Andi

#2 lore raw
Quoted 9 lines · Andi Kleen
Quoted 5 lines · Thomas Gleixner

ftp://firstfloor.org/pub/ak/x86_64/quilt/x86_64-2.6.22-rc2-070521-1.bz2

explodes in various places due to missing defines of __cold. We can't rely on the assumption that linux/compiler.h is included magically before bug.h is included. Include it explicitely.

Hmm, somehow it worked here. Perhaps longer term it would be a good idea to turn compiler.h into an -include

Might be not a bad idea. > 300 files include it directly and it's included from sched.h & co as well.

tglx

#3 lore raw
Quoted 8 lines · Thomas Gleixner
Quoted 7 lines · Andi Kleen
Quoted 5 lines · Thomas Gleixner

ftp://firstfloor.org/pub/ak/x86_64/quilt/x86_64-2.6.22-rc2-070521-1.bz2

explodes in various places due to missing defines of __cold. We can't rely on the assumption that linux/compiler.h is included magically before bug.h is included. Include it explicitely.

Quoted 5 lines
Quoted 2 lines

Hmm, somehow it worked here. Perhaps longer term it would be a good idea to turn compiler.h into an -include

Might be not a bad idea. > 300 files include it directly and it's included from sched.h & co as well.

How about a file like:
include/linux/always_include.h

This file could then include autoconf.h + compiler.h So we avoid an even longer gcc commandline.

Sam