[ 3.5.y.z extended stable ] Patch "MIPS: Rewrite pfn_valid to work in modules, too." has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Fri Aug 23 09:38:04 UTC 2013


This is a note to let you know that I have just added a patch titled

    MIPS: Rewrite pfn_valid to work in modules, too.

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 31f62d85af8f5055b646a868eb53ff46d2b9d983 Mon Sep 17 00:00:00 2001
From: Ralf Baechle <ralf at linux-mips.org>
Date: Sat, 18 May 2013 17:02:59 +0200
Subject: [PATCH] MIPS: Rewrite pfn_valid to work in modules, too.

commit 8b9232141bf40788cce31f893c13f344ec31ee66 upstream.

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 at linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 arch/mips/include/asm/page.h | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index da9bd7d..ccb77ec 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -175,14 +175,13 @@ 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;			\
-})
+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;
+}

 #elif defined(CONFIG_SPARSEMEM)

--
1.8.3.2





More information about the kernel-team mailing list