lkml.org 
[lkml]   [2003]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectWrong comment due to pte_file()
The comment above other bit tests says "if pte_present is true",
but the pte_file is backwards. A classic case of code changing
from under comments. How about abolishing all comments? :-)

diff -urN -X dontdiff linux-2.5.66/include/asm-i386/pgtable.h linux-2.5.66-sparc/include/asm-i386/pgtable.h
--- linux-2.5.66/include/asm-i386/pgtable.h 2003-03-24 14:01:14.000000000 -0800
+++ linux-2.5.66-sparc/include/asm-i386/pgtable.h 2003-03-30 16:35:04.000000000 -0800
@@ -188,6 +188,10 @@
static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; }
static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; }
static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; }
+
+/*
+ * The following only works if pte_present() is not true.
+ */
static inline int pte_file(pte_t pte) { return (pte).pte_low & _PAGE_FILE; }

static inline pte_t pte_rdprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_USER; return pte; }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.020 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site