mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
MIPS: Rewrite pfn_valid to work in modules, too.
Upstream commit 8b9232141b
.
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 <ralf@linux-mips.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
22a327d168
commit
938b7f3cfa
1 changed files with 9 additions and 8 deletions
|
@ -175,14 +175,15 @@ typedef struct { unsigned long pgprot; } pgprot_t;
|
|||
|
||||
#ifdef CONFIG_FLATMEM
|
||||
|
||||
#define pfn_valid(pfn) \
|
||||
({ \
|
||||
unsigned long __pfn = (pfn); \
|
||||
/* avoid <linux/bootmem.h> 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 <linux/mm.h> include hell */
|
||||
extern unsigned long max_mapnr;
|
||||
|
||||
return pfn >= ARCH_PFN_OFFSET && pfn < max_mapnr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#elif defined(CONFIG_SPARSEMEM)
|
||||
|
||||
|
|
Loading…
Reference in a new issue