From 938b7f3cfac46ced23a64a719062d9b56acc91aa Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 15 Aug 2013 22:35:53 -0700 Subject: MIPS: Rewrite pfn_valid to work in modules, too. Upstream commit 8b9232141bf40788cce31f893c13f344ec31ee66. 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. [Backport to 3.4 kernel. Applies cleanly on top of current 3.4 patch queue, and fixes "make ARCH=mips allmodconfig; make ARCH=mips" build problem. - Guenter] Signed-off-by: Ralf Baechle Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- arch/mips/include/asm/page.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h index da9bd7d270d1..0913b4f6e320 100644 --- a/arch/mips/include/asm/page.h +++ b/arch/mips/include/asm/page.h @@ -175,14 +175,15 @@ typedef struct { unsigned long pgprot; } pgprot_t; #ifdef CONFIG_FLATMEM -#define pfn_valid(pfn) \ -({ \ - unsigned long __pfn = (pfn); \ - /* avoid include hell */ \ - extern unsigned long min_low_pfn; \ - \ - __pfn >= min_low_pfn && __pfn < max_mapnr; \ -}) +#ifndef __ASSEMBLY__ +static inline int pfn_valid(unsigned long pfn) +{ + /* avoid include hell */ + extern unsigned long max_mapnr; + + return pfn >= ARCH_PFN_OFFSET && pfn < max_mapnr; +} +#endif #elif defined(CONFIG_SPARSEMEM) -- cgit v1.2.3