Skip to content

Commit

Permalink
MIPS: Fix CONFIG_FLATMEM version of pfn_valid()
Browse files Browse the repository at this point in the history
For systems which do not define PHYS_OFFSET as 0 pfn_valid() may falsely
have returned 0 on most configurations.  Bug introduced by commit
752fbeb2e3555c0d236e992f1195fd7ce30e728d (linux-mips.org) rsp.
6f284a2 (kernel.org) titled "[MIPS]
FLATMEM: introduce PHYS_OFFSET."

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Jul 3, 2009
1 parent 01a6221 commit baf9227
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion arch/mips/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,14 @@ typedef struct { unsigned long pgprot; } pgprot_t;

#ifdef CONFIG_FLATMEM

#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr)
#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; \
})

#elif defined(CONFIG_SPARSEMEM)

Expand Down

0 comments on commit baf9227

Please sign in to comment.