All of lore.kernel.org
 help / color / mirror / Atom feed
* Wrong comment due to pte_file()
@ 2003-03-31  2:22 Pete Zaitcev
  2003-03-31  2:37 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Pete Zaitcev @ 2003-03-31  2:22 UTC (permalink / raw)
  To: akpm, Ingo Molnar; +Cc: linux-kernel

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; }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-31  2:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-31  2:22 Wrong comment due to pte_file() Pete Zaitcev
2003-03-31  2:37 ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.