Commit 2f91ec8c authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Linus Torvalds

asm-generic, mm: pgtable: convert my_zero_pfn() to macros to fix build

Commit 816422ad ("asm-generic, mm: pgtable: consolidate zero page
helpers") broke the compile on MIPS if SPARSEMEM is enabled.  We get
this:

  In file included from arch/mips/include/asm/pgtable.h:552,
                   from include/linux/mm.h:44,
                   from arch/mips/kernel/asm-offsets.c:14:
  include/asm-generic/pgtable.h: In function 'my_zero_pfn':
  include/asm-generic/pgtable.h:466: error: implicit declaration of function 'page_to_section'
  In file included from arch/mips/kernel/asm-offsets.c:14:
  include/linux/mm.h: At top level:
  include/linux/mm.h:738: error: conflicting types for 'page_to_section'
  include/asm-generic/pgtable.h:466: note: previous implicit declaration of 'page_to_section' was here

Due header files inter-dependencies, the only way I see to fix it is
convert my_zero_pfn() for __HAVE_COLOR_ZERO_PAGE to macros.
Signed-off-by: default avatarKirill A. Shutemov <kirill@shutemov.name>
Tested-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: default avatarDavid Daney <david.daney@cavium.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7d1f9aef
...@@ -461,10 +461,8 @@ static inline int is_zero_pfn(unsigned long pfn) ...@@ -461,10 +461,8 @@ static inline int is_zero_pfn(unsigned long pfn)
return offset_from_zero_pfn <= (zero_page_mask >> PAGE_SHIFT); return offset_from_zero_pfn <= (zero_page_mask >> PAGE_SHIFT);
} }
static inline unsigned long my_zero_pfn(unsigned long addr) #define my_zero_pfn(addr) page_to_pfn(ZERO_PAGE(addr))
{
return page_to_pfn(ZERO_PAGE(addr));
}
#else #else
static inline int is_zero_pfn(unsigned long pfn) static inline int is_zero_pfn(unsigned long pfn)
{ {
......
Markdown is supported
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