Use Linux standard pattern for walking through the page table hierarchy.

As we know that the warning I once saw with this applied was related to
another, already fixed bug, my feeling is far better about this variant
now. :)

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
---
 mm/memory.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6.24-rc8-xeno_64/mm/memory.c
===================================================================
--- linux-2.6.24-rc8-xeno_64.orig/mm/memory.c
+++ linux-2.6.24-rc8-xeno_64/mm/memory.c
@@ -2827,7 +2827,7 @@ static inline int ipipe_pin_pmd_range(st
 	pmd = pmd_offset(pud, addr);
 	do {
 		next = pmd_addr_end(addr, end);
-		if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
+		if (pmd_none_or_clear_bad(pmd))
 			continue;
 		if (ipipe_pin_pte_range(mm, pmd, vma, addr, next))
 			return -ENOMEM;
@@ -2845,7 +2845,7 @@ static inline int ipipe_pin_pud_range(st
 	pud = pud_offset(pgd, addr);
 	do {
 		next = pud_addr_end(addr, end);
-		if (pud_none(*pud) || unlikely(pud_bad(*pud)))
+		if (pud_none_or_clear_bad(pud))
 			continue;
 		if (ipipe_pin_pmd_range(mm, pud, vma, addr, next))
 			return -ENOMEM;
@@ -2879,7 +2879,7 @@ int ipipe_disable_ondemand_mappings(stru
 		pgd = pgd_offset(mm, addr);
 		do {
 			next = pgd_addr_end(addr, end);
-			if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
+			if (pgd_none_or_clear_bad(pgd))
 				continue;
 			if (ipipe_pin_pud_range(mm, pgd, vma, addr, next)) {
 				result = -ENOMEM;
_______________________________________________
Adeos-main mailing list
[email protected]
https://mail.gna.org/listinfo/adeos-main

Reply via email to