MIPS: page.h: define virt_to_pfn()
PATCH 1/1 MIPS: page.h: define virt_to_pfn()
Based on the existing definition of virt_to_page() which already does a PFN_DOWN(vir_to_phys(kaddr)).
--- arch/mips/include/asm/page.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/include/asm/page.h +2 -2
@@ -240,8 +240,8 @@ static inline int pfn_valid(unsigned long pfn)#endif -#define virt_to_page (kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \ - (kaddr)))) +#define virt_to_pfn (kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr))) +#define virt_to_page (kaddr) pfn_to_page(virt_to_pfn(kaddr))extern int __virt_addr_valid (const volatile void *kaddr);#define virt_addr_valid (kaddr) \
Signature · 1 line
2.9.3
Hi Florian,
Quoted 2 lines · Florian Fainelli
Based on the existing definition of
virt_to_page()which already does a PFN_DOWN(vir_to_phys(kaddr)).
I was just wondering if there was a particular motivation for this change?
Cheers
James
Quoted 24 lines
Signed-off-by Florian Fainelli <[email protected]>--- arch/mips/include/asm/page.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/mips/include/asm/page.h +2
-2@@ -240,8 +240,8 @@ static inline int pfn_valid(unsigned long pfn)#endif -#define virt_to_page (kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \ - (kaddr)))) +#define virt_to_pfn (kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr))) +#define virt_to_page (kaddr) pfn_to_page(virt_to_pfn(kaddr))extern int __virt_addr_valid (const volatile void *kaddr);#define virt_addr_valid (kaddr) \Signature · 1 line
2.9.3
Quoted 8 lines · James Hogan
Hi Florian,
Quoted 2 lines · Florian Fainelli
Based on the existing definition of
virt_to_page()which already does a PFN_DOWN(vir_to_phys(kaddr)).I was just wondering if there was a particular motivation for this change?
Initially that was a part of an experiment to try to build and use ION on MIPS, but I think this dependency somehow got removed. I might have thought about using it for CONFIG_DEBUG_VIRTUAL too.
In then end I sent it because it sounded like a simple change that could have some use later.
Thanks for going through the patch queue :)
Quoted 28 lines
Cheers
JamesQuoted 24 lines
Signed-off-by Florian Fainelli <[email protected]>--- arch/mips/include/asm/page.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/mips/include/asm/page.h +2
-2@@ -240,8 +240,8 @@ static inline int pfn_valid(unsigned long pfn)#endif -#define virt_to_page (kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \ - (kaddr)))) +#define virt_to_pfn (kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr))) +#define virt_to_page (kaddr) pfn_to_page(virt_to_pfn(kaddr))extern int __virt_addr_valid (const volatile void *kaddr);#define virt_addr_valid (kaddr) \Signature · 1 line
2.9.3
Signature · 1 line
Florian
Quoted 10 lines · Florian Fainelli
Quoted 8 lines · James Hogan
Hi Florian,
Quoted 2 lines · Florian Fainelli
Based on the existing definition of
virt_to_page()which already does a PFN_DOWN(vir_to_phys(kaddr)).I was just wondering if there was a particular motivation for this change?
Quoted 6 lines
Initially that was a part of an experiment to try to build and use ION on MIPS, but I think this dependency somehow got removed. I might have thought about using it for
CONFIG_DEBUG_VIRTUALtoo.In then end I sent it because it sounded like a simple change that could have some use later.
Okay thanks for clarifying. I've applied for 4.15.
Cheers
James