linux-mips
[Top] [All Lists]

Re: [PATCH 36/37] Cavium OCTEON: pmd_none - use pmd_val() in pmd_val().

To: ddaney@caviumnetworks.com
Subject: Re: [PATCH 36/37] Cavium OCTEON: pmd_none - use pmd_val() in pmd_val().
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Fri, 24 Oct 2008 19:12:19 +0400
Cc: linux-mips@linux-mips.org, Paul Gortmaker <Paul.Gortmaker@windriver.com>
In-reply-to: <1224809821-5532-37-git-send-email-ddaney@caviumnetworks.com>
Organization: MontaVista Software Inc.
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1224809821-5532-1-git-send-email-ddaney@caviumnetworks.com> <1224809821-5532-37-git-send-email-ddaney@caviumnetworks.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
Hello.

ddaney@caviumnetworks.com wrote:

Before marking pmd_val as invalid_pte_table, factor in existing value
for pmd_val.

   I didn't get it -- this function doesn't mark anything.

Signed-off-by: Paul Gortmaker <Paul.Gortmaker@windriver.com>
Signed-off-by: David Daney <ddaney@caviumnetworks.com>

diff --git a/arch/mips/include/asm/pgtable-64.h 
b/arch/mips/include/asm/pgtable-64.h
index 943515f..bb93bd5 100644
--- a/arch/mips/include/asm/pgtable-64.h
+++ b/arch/mips/include/asm/pgtable-64.h
@@ -129,7 +129,12 @@ extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD];
  */
 static inline int pmd_none(pmd_t pmd)
 {
+#ifdef CONFIG_CPU_CAVIUM_OCTEON
+       return (pmd_val(pmd) == (unsigned long) invalid_pte_table) ||
+                               (!pmd_val(pmd));

Unneeded parens around !pmd_val(pmd) -- ! operator is higher priority than any of && and ||.

WBR, Sergei

<Prev in Thread] Current Thread [Next in Thread>