Commit f9918794 authored by Ian Campbell's avatar Ian Campbell Committed by Linus Torvalds
Browse files

mm: make HASHED_PAGE_VIRTUAL page_address' struct page argument const.

Followup to 33dd4e0e

 "mm: make some struct page's const" which missed the
HASHED_PAGE_VIRTUAL case.
Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Rik van Riel <riel@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: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 72ed62bd
...@@ -63,7 +63,7 @@ static inline u32 hash_32(u32 val, unsigned int bits) ...@@ -63,7 +63,7 @@ static inline u32 hash_32(u32 val, unsigned int bits)
return hash >> (32 - bits); return hash >> (32 - bits);
} }
static inline unsigned long hash_ptr(void *ptr, unsigned int bits) static inline unsigned long hash_ptr(const void *ptr, unsigned int bits)
{ {
return hash_long((unsigned long)ptr, bits); return hash_long((unsigned long)ptr, bits);
} }
......
...@@ -737,7 +737,7 @@ static __always_inline void *lowmem_page_address(const struct page *page) ...@@ -737,7 +737,7 @@ static __always_inline void *lowmem_page_address(const struct page *page)
#endif #endif
#if defined(HASHED_PAGE_VIRTUAL) #if defined(HASHED_PAGE_VIRTUAL)
void *page_address(struct page *page); void *page_address(const struct page *page);
void set_page_address(struct page *page, void *virtual); void set_page_address(struct page *page, void *virtual);
void page_address_init(void); void page_address_init(void);
#endif #endif
......
...@@ -326,7 +326,7 @@ static struct page_address_slot { ...@@ -326,7 +326,7 @@ static struct page_address_slot {
spinlock_t lock; /* Protect this bucket's list */ spinlock_t lock; /* Protect this bucket's list */
} ____cacheline_aligned_in_smp page_address_htable[1<<PA_HASH_ORDER]; } ____cacheline_aligned_in_smp page_address_htable[1<<PA_HASH_ORDER];
static struct page_address_slot *page_slot(struct page *page) static struct page_address_slot *page_slot(const struct page *page)
{ {
return &page_address_htable[hash_ptr(page, PA_HASH_ORDER)]; return &page_address_htable[hash_ptr(page, PA_HASH_ORDER)];
} }
...@@ -337,7 +337,7 @@ static struct page_address_slot *page_slot(struct page *page) ...@@ -337,7 +337,7 @@ static struct page_address_slot *page_slot(struct page *page)
* *
* Returns the page's virtual address. * Returns the page's virtual address.
*/ */
void *page_address(struct page *page) void *page_address(const struct page *page)
{ {
unsigned long flags; unsigned long flags;
void *ret; void *ret;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment