MIPS: Make phys_to_virt utilize __va()
PATCH 1/1 MIPS: Make phys_to_virt utilize __va()
The implementation is exactly the same, so avoid open-coding it in two different locations.
Signed-off-by Florian Fainelli <[email protected]>
--- arch/mips/include/asm/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/io.h +1 -1
@@ -131,7 +131,7 @@ static inline phys_addr_t virt_to_phys(const volatile void *x)*/ static inline void *phys_to_virt (unsigned long address) { -return (void *)(address +PAGE_OFFSET -PHYS_OFFSET ); +return __va (address); }/*
Signature · 1 line
2.25.1
Quoted 4 lines · Florian Fainelli
The implementation is exactly the same, so avoid open-coding it in two different locations.
Signed-off-by Florian Fainelli <[email protected]>
Seems reasonable. Thanks.
Reviewed-by Serge Semin <[email protected]>
*Note it now looks exactly as the generic phys_to_virt().
-Sergey
Quoted 20 lines
--- arch/mips/include/asm/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/mips/include/asm/io.h +1
-1@@ -131,7 +131,7 @@ static inline phys_addr_t virt_to_phys(const volatile void *x)*/ static inline void *phys_to_virt (unsigned long address) { -return (void *)(address +PAGE_OFFSET -PHYS_OFFSET ); +return __va (address); }/* Signature · 1 line
2.25.1
Quoted 11 lines · Serge Semin
Quoted 4 lines · Florian Fainelli
The implementation is exactly the same, so avoid open-coding it in two different locations.
Signed-off-by Florian Fainelli <[email protected]>Seems reasonable. Thanks.
Reviewed-by Serge Semin <[email protected]>*Note it now looks exactly as the generic
phys_to_virt().
True, though switching to asm-generic/io.h is a slightly bigger undertaking. I will cook something towards that goal however.
Signature · 1 line
Florian
Quoted 23 lines · Florian Fainelli
The implementation is exactly the same, so avoid open-coding it in two different locations.
Signed-off-by Florian Fainelli <[email protected]>--- arch/mips/include/asm/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/mips/include/asm/io.h +1
-1@@ -131,7 +131,7 @@ static inline phys_addr_t virt_to_phys(const volatile void *x)*/ static inline void *phys_to_virt (unsigned long address) { -return (void *)(address +PAGE_OFFSET -PHYS_OFFSET ); +return __va (address); }/* Signature · 1 line
2.25.1
applied to mips-next.
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]