Skip to content

Commit

Permalink
MIPS: Fix modpost error in modules attepting to use virt_addr_valid().
Browse files Browse the repository at this point in the history
ERROR: "min_low_pfn" [drivers/block/aoe/aoe.ko] undefined!

Fixed by moving the implementation of virt_addr_valid() into the kernel
proper and exporting it which removes the pains of an inline or macro
implementation.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Dec 28, 2012
1 parent 730b8df commit d3ce884
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/mips/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ typedef struct { unsigned long pgprot; } pgprot_t;
#endif

#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
#define virt_addr_valid(kaddr) pfn_valid(PFN_DOWN(virt_to_phys(kaddr)))

extern int __virt_addr_valid(const volatile void *kaddr);
#define virt_addr_valid(kaddr) \
__virt_addr_valid((const volatile void *) (kaddr))

#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
Expand Down
6 changes: 6 additions & 0 deletions arch/mips/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,9 @@ void __iounmap(const volatile void __iomem *addr)

EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(__iounmap);

int __virt_addr_valid(const volatile void *kaddr)
{
return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
}
EXPORT_SYMBOL_GPL(__virt_addr_valid);

0 comments on commit d3ce884

Please sign in to comment.