History

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.

Ian Campbell committed 15 years ago

Commit aa462ab1 parent f9918792 files · +4 −4Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/mm.h+2−2
@@ -685,7 +685,7 @@ static inline void set_page_section(struct page *page, unsigned long section) · 684 unmodified lines
685685 page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
686686 }
687687
688−static inline unsigned long page_to_section(struct page *page)
688+static inline unsigned long page_to_section(const struct page *page)
689689 {
690690 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
691691 }
@@ -720,7 +720,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone, · 28 unmodified lines
720720
721721 static __always_inline void *lowmem_page_address(const struct page *page)
722722 {
723− return __va(PFN_PHYS(page_to_pfn((struct page *)page)));
723+ return __va(PFN_PHYS(page_to_pfn(page)));
724724 }
725725
726726 #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)