Message ID | CAMuHMdVa_+aBK3qnSPLj9DrVGB_77y5t97idskR_cGTrc1N8Yw@mail.gmail.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Paul Mundt |
Headers | show |
On Fri, 13 Dec 2013 09:51:00 +0100 Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Note that Ralf decided to fix it differently, by uninlining virt_addr_valid:
geeze, what a mess this is.
I suppose that the proposed sh patch is reasonable - it's the sh
implementation of virt_addr_valid() whcih chooses to use these symbols
so sh should export them to support that implementation.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
2013/12/14 Andrew Morton <akpm@linux-foundation.org>: > On Fri, 13 Dec 2013 09:51:00 +0100 Geert Uytterhoeven <geert@linux-m68k.org> wrote: > >> Note that Ralf decided to fix it differently, by uninlining virt_addr_valid: > > geeze, what a mess this is. > > I suppose that the proposed sh patch is reasonable - it's the sh > implementation of virt_addr_valid() whcih chooses to use these symbols > so sh should export them to support that implementation. Andrew, thanks for your comment. Geert, do you think about this? Best regards, Nobuhiro
On Mon, Dec 16, 2013 at 2:28 AM, Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> wrote: > 2013/12/14 Andrew Morton <akpm@linux-foundation.org>: >> On Fri, 13 Dec 2013 09:51:00 +0100 Geert Uytterhoeven <geert@linux-m68k.org> wrote: >> >>> Note that Ralf decided to fix it differently, by uninlining virt_addr_valid: >> >> geeze, what a mess this is. >> >> I suppose that the proposed sh patch is reasonable - it's the sh >> implementation of virt_addr_valid() whcih chooses to use these symbols >> so sh should export them to support that implementation. > > Andrew, thanks for your comment. > > Geert, do you think about this? Both are valid solutions: either you fix it at the high level, like MIPS does, or at the low level. It's just about what you want to expose, and if you want to risk people touching too much innards. Anyway: Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
2013/12/16 Geert Uytterhoeven <geert@linux-m68k.org>: > On Mon, Dec 16, 2013 at 2:28 AM, Nobuhiro Iwamatsu > <nobuhiro.iwamatsu.yj@renesas.com> wrote: >> 2013/12/14 Andrew Morton <akpm@linux-foundation.org>: >>> On Fri, 13 Dec 2013 09:51:00 +0100 Geert Uytterhoeven <geert@linux-m68k.org> wrote: >>> >>>> Note that Ralf decided to fix it differently, by uninlining virt_addr_valid: >>> >>> geeze, what a mess this is. >>> >>> I suppose that the proposed sh patch is reasonable - it's the sh >>> implementation of virt_addr_valid() whcih chooses to use these symbols >>> so sh should export them to support that implementation. >> >> Andrew, thanks for your comment. >> >> Geert, do you think about this? > > Both are valid solutions: either you fix it at the high level, like MIPS > does, or at the low level. It's just about what you want to expose, and > if you want to risk people touching too much innards. > I see. I understood > Anyway: > > Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Thanks. > > Gr{oetje,eeting}s, > > Geert > Best regards, Nobuhiro -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h index bf84e48ad669..dbaec94046da 100644 --- a/arch/mips/include/asm/page.h +++ b/arch/mips/include/asm/page.h @@ -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) diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c index cacfd31e8ec9..7657fd21cd3f 100644 --- a/arch/mips/mm/ioremap.c +++ b/arch/mips/mm/ioremap.c @@ -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);