diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-06-23 15:37:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-23 15:50:05 -0400 |
commit | 01ff53f416757da416413bc32229770a8448b6ef (patch) | |
tree | 31374589a0a6116ff3d756137fa0b0ac87f49e2e /include | |
parent | a5c9b696ec109bb54d547fdb437a7a0c2d514670 (diff) |
rmap: fixup page_referenced() for nommu systems
After the recent changes that went into mm/vmscan.c to overhaul stuff, we
ended up with these warnings on no-mmu systems:
mm/vmscan.c: In function `shrink_page_list':
mm/vmscan.c:580: warning: unused variable `vm_flags'
mm/vmscan.c: In function `shrink_active_list':
mm/vmscan.c:1294: warning: `vm_flags' may be used uninitialized in this function
mm/vmscan.c:1242: note: `vm_flags' was declared here
This is because the no-mmu function defines page_referenced() to work on
the first argument only (the page). It does not clear the vm_flags given
to it because for no-mmu systems, they never actually get utilized. Since
that is no longer strictly true, we need to set vm_flags to 0 like
everyone else so gcc can do proper dead code elimination without annoying
us with unused warnings.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: David Howells <dhowells@redhat.com>
Acked-by: David McCullough <davidm@snapgear.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/rmap.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 216d024f830d..bf116d0dbf23 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -118,7 +118,14 @@ int try_to_munlock(struct page *); | |||
118 | #define anon_vma_prepare(vma) (0) | 118 | #define anon_vma_prepare(vma) (0) |
119 | #define anon_vma_link(vma) do {} while (0) | 119 | #define anon_vma_link(vma) do {} while (0) |
120 | 120 | ||
121 | #define page_referenced(page, locked, cnt, flags) TestClearPageReferenced(page) | 121 | static inline int page_referenced(struct page *page, int is_locked, |
122 | struct mem_cgroup *cnt, | ||
123 | unsigned long *vm_flags) | ||
124 | { | ||
125 | *vm_flags = 0; | ||
126 | return TestClearPageReferenced(page); | ||
127 | } | ||
128 | |||
122 | #define try_to_unmap(page, refs) SWAP_FAIL | 129 | #define try_to_unmap(page, refs) SWAP_FAIL |
123 | 130 | ||
124 | static inline int page_mkclean(struct page *page) | 131 | static inline int page_mkclean(struct page *page) |