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/linux | |
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/linux')
-rw-r--r-- | include/linux/mm.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index c06454d60a3..7438071b44a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -685,7 +685,7 @@ static inline void set_page_section(struct page *page, unsigned long section) | |||
685 | page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; | 685 | page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; |
686 | } | 686 | } |
687 | 687 | ||
688 | static inline unsigned long page_to_section(struct page *page) | 688 | static inline unsigned long page_to_section(const struct page *page) |
689 | { | 689 | { |
690 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; | 690 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; |
691 | } | 691 | } |
@@ -720,7 +720,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone, | |||
720 | 720 | ||
721 | static __always_inline void *lowmem_page_address(const struct page *page) | 721 | static __always_inline void *lowmem_page_address(const struct page *page) |
722 | { | 722 | { |
723 | return __va(PFN_PHYS(page_to_pfn((struct page *)page))); | 723 | return __va(PFN_PHYS(page_to_pfn(page))); |
724 | } | 724 | } |
725 | 725 | ||
726 | #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) | 726 | #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) |