All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Make phys_to_virt utilize __va()
@ 2022-07-07 20:37 Florian Fainelli
  2022-07-08 12:34 ` Serge Semin
  2022-07-11  8:38 ` Thomas Bogendoerfer
  0 siblings, 2 replies; 4+ messages in thread
From: Florian Fainelli @ 2022-07-07 20:37 UTC (permalink / raw)
  To: linux-mips; +Cc: Florian Fainelli, Thomas Bogendoerfer, open list

The implementation is exactly the same, so avoid open-coding it in two
different locations.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/mips/include/asm/io.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 6f5c86d2bab4..880048a54362 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -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);
 }
 
 /*
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] MIPS: Make phys_to_virt utilize __va()
  2022-07-07 20:37 [PATCH] MIPS: Make phys_to_virt utilize __va() Florian Fainelli
@ 2022-07-08 12:34 ` Serge Semin
  2022-07-08 16:21   ` Florian Fainelli
  2022-07-11  8:38 ` Thomas Bogendoerfer
  1 sibling, 1 reply; 4+ messages in thread
From: Serge Semin @ 2022-07-08 12:34 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: linux-mips, Thomas Bogendoerfer, open list

On Thu, Jul 07, 2022 at 01:37:42PM -0700, Florian Fainelli wrote:
> The implementation is exactly the same, so avoid open-coding it in two
> different locations.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Seems reasonable. Thanks.

Reviewed-by: Serge Semin <fancer.lancer@gmail.com>

*Note it now looks exactly as the generic phys_to_virt().

-Sergey

> ---
>  arch/mips/include/asm/io.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
> index 6f5c86d2bab4..880048a54362 100644
> --- a/arch/mips/include/asm/io.h
> +++ b/arch/mips/include/asm/io.h
> @@ -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);
>  }
>  
>  /*
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] MIPS: Make phys_to_virt utilize __va()
  2022-07-08 12:34 ` Serge Semin
@ 2022-07-08 16:21   ` Florian Fainelli
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2022-07-08 16:21 UTC (permalink / raw)
  To: Serge Semin; +Cc: linux-mips, Thomas Bogendoerfer, open list

On 7/8/22 05:34, Serge Semin wrote:
> On Thu, Jul 07, 2022 at 01:37:42PM -0700, Florian Fainelli wrote:
>> The implementation is exactly the same, so avoid open-coding it in two
>> different locations.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> Seems reasonable. Thanks.
> 
> Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
> 
> *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.
-- 
Florian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] MIPS: Make phys_to_virt utilize __va()
  2022-07-07 20:37 [PATCH] MIPS: Make phys_to_virt utilize __va() Florian Fainelli
  2022-07-08 12:34 ` Serge Semin
@ 2022-07-11  8:38 ` Thomas Bogendoerfer
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 2022-07-11  8:38 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: linux-mips, open list

On Thu, Jul 07, 2022 at 01:37:42PM -0700, Florian Fainelli wrote:
> The implementation is exactly the same, so avoid open-coding it in two
> different locations.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  arch/mips/include/asm/io.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
> index 6f5c86d2bab4..880048a54362 100644
> --- a/arch/mips/include/asm/io.h
> +++ b/arch/mips/include/asm/io.h
> @@ -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);
>  }
>  
>  /*
> -- 
> 2.25.1

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-11  8:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-07 20:37 [PATCH] MIPS: Make phys_to_virt utilize __va() Florian Fainelli
2022-07-08 12:34 ` Serge Semin
2022-07-08 16:21   ` Florian Fainelli
2022-07-11  8:38 ` Thomas Bogendoerfer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.