]> git.hungrycats.org Git - linux/commitdiff
[SPARC]: Do not BUG() in srmmu_pte_pfn().
authorDavid S. Miller <davem@nuts.davemloft.net>
Sat, 12 Feb 2005 03:14:59 +0000 (19:14 -0800)
committerDavid S. Miller <davem@nuts.davemloft.net>
Sat, 12 Feb 2005 03:14:59 +0000 (19:14 -0800)
For device memory, just return a value that will never
cause pte_pfn() to return true.

Noticed by Tom Callaway.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/mm/srmmu.c

index 71e3f2678e73bd7e73e351ae348846cd7beec0f2..533946c574c760090efd77ed974aa136e846fbc4 100644 (file)
@@ -133,11 +133,12 @@ static struct bit_map srmmu_nocache_map;
 static unsigned long srmmu_pte_pfn(pte_t pte)
 {
        if (srmmu_device_memory(pte_val(pte))) {
-               /* XXX Anton obviously had something in mind when he did this.
-                * But what?
+               /* Just return something that will cause
+                * pfn_valid() to return false.  This makes
+                * copy_one_pte() to just directly copy to
+                * PTE over.
                 */
-               /* return (struct page *)~0; */
-               BUG();
+               return ~0UL;
        }
        return (pte_val(pte) & SRMMU_PTE_PMASK) >> (PAGE_SHIFT-4);
 }