diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2013-05-18 11:02:59 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-05-19 03:56:58 -0400 |
commit | 8b9232141bf40788cce31f893c13f344ec31ee66 (patch) | |
tree | f43c727a62b114b2541e8744419df76a1efd2698 /arch/mips/include/asm/page.h | |
parent | 130901ba33c4a040e12cf7cce240c1056cc096ee (diff) |
MIPS: Rewrite pfn_valid to work in modules, too.
This fixes:
MODPOST 393 modules
ERROR: "min_low_pfn" [arch/mips/kvm/kvm.ko] undefined!
make[3]: *** [__modpost] Error 1
It would have been possible to just export min_low_pfn but in the end
pfn_valid should return 1 for any pfn argument for which a struct page
exists so using min_low_pfn was wrong anyway.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/page.h')
-rw-r--r-- | arch/mips/include/asm/page.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h index ec1ca537fbc1..f59552fae917 100644 --- a/arch/mips/include/asm/page.h +++ b/arch/mips/include/asm/page.h | |||
@@ -171,14 +171,13 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
171 | 171 | ||
172 | #ifdef CONFIG_FLATMEM | 172 | #ifdef CONFIG_FLATMEM |
173 | 173 | ||
174 | #define pfn_valid(pfn) \ | 174 | static inline int pfn_valid(unsigned long pfn) |
175 | ({ \ | 175 | { |
176 | unsigned long __pfn = (pfn); \ | 176 | /* avoid <linux/mm.h> include hell */ |
177 | /* avoid <linux/bootmem.h> include hell */ \ | 177 | extern unsigned long max_mapnr; |
178 | extern unsigned long min_low_pfn; \ | 178 | |
179 | \ | 179 | return pfn >= ARCH_PFN_OFFSET && pfn < max_mapnr; |
180 | __pfn >= min_low_pfn && __pfn < max_mapnr; \ | 180 | } |
181 | }) | ||
182 | 181 | ||
183 | #elif defined(CONFIG_SPARSEMEM) | 182 | #elif defined(CONFIG_SPARSEMEM) |
184 | 183 | ||