Skip to content

Commit

Permalink
mm/page_ext.c: constify lookup_page_ext() argument
Browse files Browse the repository at this point in the history
lookup_page_ext() finds 'struct page_ext' for a given page.  It requires
only read access to the given struct page.

Current implemnentation takes 'struct page *' as an argument.  It makes
compiler complain when 'const struct page *' passed.

Change the argument to 'const struct page *'.

Link: http://lkml.kernel.org/r/20180531135457.20167-3-kirill.shutemov@linux.intel.com
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Kirill A. Shutemov authored and Linus Torvalds committed Aug 17, 2018
1 parent b3a2369 commit 10ed634
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/linux/page_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static inline void page_ext_init(void)
}
#endif

struct page_ext *lookup_page_ext(struct page *page);
struct page_ext *lookup_page_ext(const struct page *page);

#else /* !CONFIG_PAGE_EXTENSION */
struct page_ext;
Expand All @@ -59,7 +59,7 @@ static inline void pgdat_page_ext_init(struct pglist_data *pgdat)
{
}

static inline struct page_ext *lookup_page_ext(struct page *page)
static inline struct page_ext *lookup_page_ext(const struct page *page)
{
return NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions mm/page_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void __meminit pgdat_page_ext_init(struct pglist_data *pgdat)
pgdat->node_page_ext = NULL;
}

struct page_ext *lookup_page_ext(struct page *page)
struct page_ext *lookup_page_ext(const struct page *page)
{
unsigned long pfn = page_to_pfn(page);
unsigned long index;
Expand Down Expand Up @@ -195,7 +195,7 @@ void __init page_ext_init_flatmem(void)

#else /* CONFIG_FLAT_NODE_MEM_MAP */

struct page_ext *lookup_page_ext(struct page *page)
struct page_ext *lookup_page_ext(const struct page *page)
{
unsigned long pfn = page_to_pfn(page);
struct mem_section *section = __pfn_to_section(pfn);
Expand Down

0 comments on commit 10ed634

Please sign in to comment.