diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-08-17 12:40:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-17 16:00:20 -0400 |
commit | aa462abe8aaf2198d6aef97da20c874ac694a39f (patch) | |
tree | f7c1b4e82fe8eeaad8ce61a5e9e4d301accaf32b /include/asm-generic/memory_model.h | |
parent | f991879473828f320a714e9494fb37a26ccd6b66 (diff) |
mm: fix __page_to_pfn for a const struct page argument
This allows the cast in lowmem_page_address (introduced as a warning
fixup to 33dd4e0ec911 "mm: make some struct page's const") to be
removed.
Propagate const'ness to page_to_section() as well since it is required
by __page_to_pfn.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic/memory_model.h')
-rw-r--r-- | include/asm-generic/memory_model.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h index fb2d63f13f4c..aea9e45efce6 100644 --- a/include/asm-generic/memory_model.h +++ b/include/asm-generic/memory_model.h | |||
@@ -39,7 +39,7 @@ | |||
39 | }) | 39 | }) |
40 | 40 | ||
41 | #define __page_to_pfn(pg) \ | 41 | #define __page_to_pfn(pg) \ |
42 | ({ struct page *__pg = (pg); \ | 42 | ({ const struct page *__pg = (pg); \ |
43 | struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ | 43 | struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ |
44 | (unsigned long)(__pg - __pgdat->node_mem_map) + \ | 44 | (unsigned long)(__pg - __pgdat->node_mem_map) + \ |
45 | __pgdat->node_start_pfn; \ | 45 | __pgdat->node_start_pfn; \ |
@@ -57,7 +57,7 @@ | |||
57 | * section[i].section_mem_map == mem_map's address - start_pfn; | 57 | * section[i].section_mem_map == mem_map's address - start_pfn; |
58 | */ | 58 | */ |
59 | #define __page_to_pfn(pg) \ | 59 | #define __page_to_pfn(pg) \ |
60 | ({ struct page *__pg = (pg); \ | 60 | ({ const struct page *__pg = (pg); \ |
61 | int __sec = page_to_section(__pg); \ | 61 | int __sec = page_to_section(__pg); \ |
62 | (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \ | 62 | (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \ |
63 | }) | 63 | }) |