Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / arch / m68k / mm / kmap.c
index 85ad19a..f46f049 100644 (file)
@@ -7,7 +7,6 @@
  *          used by other architectures                /Roman Zippel
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -259,13 +258,15 @@ void __iounmap(void *addr, unsigned long size)
 
                if (CPU_IS_020_OR_030) {
                        int pmd_off = (virtaddr/PTRTREESIZE) & 15;
+                       int pmd_type = pmd_dir->pmd[pmd_off] & _DESCTYPE_MASK;
 
-                       if ((pmd_dir->pmd[pmd_off] & _DESCTYPE_MASK) == _PAGE_PRESENT) {
+                       if (pmd_type == _PAGE_PRESENT) {
                                pmd_dir->pmd[pmd_off] = 0;
                                virtaddr += PTRTREESIZE;
                                size -= PTRTREESIZE;
                                continue;
-                       }
+                       } else if (pmd_type == 0)
+                               continue;
                }
 
                if (pmd_bad(*pmd_dir)) {