Skip to content

Commit

Permalink
mm: make HASHED_PAGE_VIRTUAL page_address' struct page argument const.
Browse files Browse the repository at this point in the history
Followup to 33dd4e0 "mm: make some struct page's const" which missed the
HASHED_PAGE_VIRTUAL case.

Signed-off-by: Ian 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: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ian Campbell authored and Linus Torvalds committed Aug 17, 2011
1 parent 72ed62b commit f991879
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/linux/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static inline u32 hash_32(u32 val, unsigned int 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);
}
Expand Down
2 changes: 1 addition & 1 deletion include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ static __always_inline void *lowmem_page_address(const struct page *page)
#endif

#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 page_address_init(void);
#endif
Expand Down
4 changes: 2 additions & 2 deletions mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ static struct page_address_slot {
spinlock_t lock; /* Protect this bucket's list */
} ____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)];
}
Expand All @@ -337,7 +337,7 @@ static struct page_address_slot *page_slot(struct page *page)
*
* Returns the page's virtual address.
*/
void *page_address(struct page *page)
void *page_address(const struct page *page)
{
unsigned long flags;
void *ret;
Expand Down

0 comments on commit f991879

Please sign in to comment.