Thread (14 messages) 14 messages, 5 authors, 2005-08-18

Re: [PATCH 3/4] x86-walk-check

From: Dave Hansen <hidden>
Date: 2005-08-17 19:41:06

On Wed, 2005-08-17 at 14:04 -0500, Adam Litke wrote:
+       if (pgd_present(*pgd)) {
+               pud = pud_offset(pgd, addr);
+               if (pud_present(*pud)) {
+                       pmd = pmd_offset(pud, addr);
+               }
+       }
You can probably kill that extra set of braces on the indented if().

Or, do something like this (which I think is a little bit more
consistent with a lot of other code.

-       pud = pud_offset(pgd, addr);
-       pmd = pmd_offset(pud, addr);
+       if (!pgd_present(*pgd))
+		goto out;
+
+       pud = pud_offset(pgd, addr);
+       if (pud_present(*pud))
+       	pmd = pmd_offset(pud, addr);
+
+out:
        return (pte_t *) pmd;

-- Dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help