public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: powerpc: Fix STRICT_MM_TYPECHECKS
Date: Mon, 30 Apr 2007 15:37:06 +1000	[thread overview]
Message-ID: <20070430053705.GF6436@localhost.localdomain> (raw)

Since we don't have it active by default, the STRICT_MM_TYPECHECKS
option has bitrotted again.  This patch fixes a couple of simple build
fixes if the option is selected.  First, pud_t mustn't be defined in
page.h on 32-bit systems, because it conflicts with the version in the
generic pud-folding code.  Second, pci_32.c is missing a __pgprot()
wrapper call.  Third, a couple of PS3 files use constants of type
pgprot_t when they need the raw values, we add pgprot_val() calls to
fix this.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

---
 arch/powerpc/kernel/pci_32.c      |    2 +-
 arch/powerpc/platforms/ps3/htab.c |    3 ++-
 arch/powerpc/platforms/ps3/spu.c  |    2 +-
 include/asm-powerpc/page.h        |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

Index: working-2.6/include/asm-powerpc/page.h
===================================================================
--- working-2.6.orig/include/asm-powerpc/page.h	2007-04-30 15:33:05.000000000 +1000
+++ working-2.6/include/asm-powerpc/page.h	2007-04-30 15:36:20.000000000 +1000
@@ -126,7 +126,7 @@ typedef struct { unsigned long pmd; } pm
 #define __pmd(x)	((pmd_t) { (x) })
 
 /* PUD level exusts only on 4k pages */
-#ifndef CONFIG_PPC_64K_PAGES
+#if defined(CONFIG_PPC64) && !defined(CONFIG_PPC_64K_PAGES)
 typedef struct { unsigned long pud; } pud_t;
 #define pud_val(x)	((x).pud)
 #define __pud(x)	((pud_t) { (x) })
Index: working-2.6/arch/powerpc/kernel/pci_32.c
===================================================================
--- working-2.6.orig/arch/powerpc/kernel/pci_32.c	2007-04-30 15:33:00.000000000 +1000
+++ working-2.6/arch/powerpc/kernel/pci_32.c	2007-04-30 15:33:11.000000000 +1000
@@ -1658,7 +1658,7 @@ pgprot_t pci_phys_mem_access_prot(struct
 	int i;
 
 	if (page_is_ram(pfn))
-		return prot;
+		return __pgprot(prot);
 
 	prot |= _PAGE_NO_CACHE | _PAGE_GUARDED;
 
Index: working-2.6/arch/powerpc/platforms/ps3/spu.c
===================================================================
--- working-2.6.orig/arch/powerpc/platforms/ps3/spu.c	2007-04-30 15:33:00.000000000 +1000
+++ working-2.6/arch/powerpc/platforms/ps3/spu.c	2007-04-30 15:33:11.000000000 +1000
@@ -184,7 +184,7 @@ static int __init setup_areas(struct spu
 
 	spu_pdata(spu)->shadow = __ioremap(
 		spu_pdata(spu)->shadow_addr, sizeof(struct spe_shadow),
-		PAGE_READONLY | _PAGE_NO_CACHE | _PAGE_GUARDED);
+		pgprot_val(PAGE_READONLY) | _PAGE_NO_CACHE | _PAGE_GUARDED);
 	if (!spu_pdata(spu)->shadow) {
 		pr_debug("%s:%d: ioremap shadow failed\n", __func__, __LINE__);
 		goto fail_ioremap;
Index: working-2.6/arch/powerpc/platforms/ps3/htab.c
===================================================================
--- working-2.6.orig/arch/powerpc/platforms/ps3/htab.c	2007-04-30 15:33:01.000000000 +1000
+++ working-2.6/arch/powerpc/platforms/ps3/htab.c	2007-04-30 15:33:11.000000000 +1000
@@ -273,7 +273,8 @@ void __init ps3_map_htab(void)
 
 	result = lv1_map_htab(0, &htab_addr);
 
-	htab = (hpte_t *)__ioremap(htab_addr, htab_size, PAGE_READONLY_X);
+	htab = (hpte_t *)__ioremap(htab_addr, htab_size,
+				   pgprot_val(PAGE_READONLY_X));
 
 	DBG("%s:%d: lpar %016lxh, virt %016lxh\n", __func__, __LINE__,
 		htab_addr, (unsigned long)htab);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

                 reply	other threads:[~2007-04-30  5:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070430053705.GF6436@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox