Skip to contentSkip to conversation

m68k: avoid pgprot_noncached redefinition

PATCH In review Heiko Carstens 2 participants 3 messages Aug 27, 2009 m68k architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68k: avoid pgprot_noncached redefinition

From: Heiko Carstens <[email protected]>

While compiling m68k with defconfig I get tons if these warnings:

/home2/heicarst/linux-2.6/arch/m68k/include/asm/pgtable_mm.h:148:1: warning: "pgprot_noncached" redefined In file included from /home2/heicarst/linux-2.6/arch/m68k/include/asm/pgtable_mm.h:138,
from /home2/heicarst/linux-2.6/arch/m68k/include/asm/pgtable.h:4,
from include/linux/mm.h:38,
from /home2/heicarst/linux-2.6/arch/m68k/include/asm/atarihw.h:134,
from arch/m68k/atari/debug.c:20:
include/asm-generic/pgtable.h:133:1: warning: this is the location of the previous definition

Reason for this is that asm-generic/pgtable.h gets included in pgtable_mm.h before pgprot_noncached gets defined.
So the check "#ifndef pgprot_noncached" in the generic header file is too early. Solve this by including the generic header file after the arch define.

---
 arch/m68k/include/asm/pgtable_mm.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/m68k/include/asm/pgtable_mm.h +2 -1
Index: linux-2.6/arch/m68k/include/asm/pgtable_mm.h
===================================================================
@@ -135,7 +135,6 @@ static inline void update_mmu_cache(stru
 #endif
 
 #ifndef __ASSEMBLY__
-#include <asm-generic/pgtable.h>
 
 /*
  * Macro to mark a page protection value as "uncacheable".
@@ -154,6 +153,8 @@ static inline void update_mmu_cache(stru
 	    ? (__pgprot((pgprot_val(prot) & _CACHEMASK040) | _PAGE_NOCACHE_S))	\
 	    : (prot)))
 
+#include <asm-generic/pgtable.h>
+
 #endif /* !__ASSEMBLY__ */
 
 /*
#1 lore raw
Quoted 12 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

While compiling m68k with defconfig I get tons if these warnings:

/home2/heicarst/linux-2.6/arch/m68k/include/asm/pgtable_mm.h:148:1: warning: "pgprot_noncached" redefined In file included from /home2/heicarst/linux-2.6/arch/m68k/include/asm/pgtable_mm.h:138, from /home2/heicarst/linux-2.6/arch/m68k/include/asm/pgtable.h:4,
 from include/linux/mm.h:38,
 from /home2/heicarst/linux-2.6/arch/m68k/include/asm/atarihw.h:134,
 from arch/m68k/atari/debug.c:20:
include/asm-generic/pgtable.h:133:1: warning: this is the location of the previous definition

Quoted 4 lines

Reason for this is that asm-generic/pgtable.h gets included in pgtable_mm.h before pgprot_noncached gets defined.
So the check "#ifndef pgprot_noncached" in the generic header file is too early. Solve this by including the generic header file after the arch define.

Thanks, but Linus has just pulled the fix last night.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw
Quoted 13 lines · Geert Uytterhoeven
Quoted 12 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

While compiling m68k with defconfig I get tons if these warnings:

/home2/heicarst/linux-2.6/arch/m68k/include/asm/pgtable_mm.h:148:1: warning: "pgprot_noncached" redefined In file included from /home2/heicarst/linux-2.6/arch/m68k/include/asm/pgtable_mm.h:138, from /home2/heicarst/linux-2.6/arch/m68k/include/asm/pgtable.h:4,
 from include/linux/mm.h:38,
 from /home2/heicarst/linux-2.6/arch/m68k/include/asm/atarihw.h:134,
 from arch/m68k/atari/debug.c:20:
include/asm-generic/pgtable.h:133:1: warning: this is the location of the previous definition

Quoted 6 lines
Quoted 4 lines

Reason for this is that asm-generic/pgtable.h gets included in pgtable_mm.h before pgprot_noncached gets defined.
So the check "#ifndef pgprot_noncached" in the generic header file is too early. Solve this by including the generic header file after the arch define.

Thanks, but Linus has just pulled the fix last night.

Ah, good! Just stumbled across these when trying to cross compile the spinlock inline patches on m68k.
To get spinlock inline patches running on m68k some more patches are needed. I'm going to post them when I've (build) tested more architectures.