mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] asm: align virt_to_phys definitions
@ 2023-06-12 12:59 Ahmad Fatoum
  2023-06-13  8:37 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-06-12 12:59 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We have two definitions of virt_to_phys: One for MIPS code accepting both
const and non-const pointers and one for everybody else that accepts
volatile and non-volatile pointers. Unify both to have a common
definition with the superset of the qualifiers.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/mips/include/asm/io.h | 2 +-
 include/asm-generic/io.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 9c856c7b1552..4584eec8ca07 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -28,7 +28,7 @@ void dma_inv_range(unsigned long, unsigned long);
  *     the memory address given.
  */
 #define virt_to_phys virt_to_phys
-static inline unsigned long virt_to_phys(const void *address)
+static inline unsigned long virt_to_phys(const volatile void *address)
 {
 	return CPHYSADDR((unsigned long)address);
 }
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 6e91c0aea68f..ab439026928a 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -769,7 +769,7 @@ static inline void iowrite64_rep(volatile void __iomem *addr,
  */
 #ifndef virt_to_phys
 #define virt_to_phys virt_to_phys
-static inline unsigned long virt_to_phys(volatile void *mem)
+static inline unsigned long virt_to_phys(const volatile void *mem)
 {
 	return (unsigned long)mem;
 }
-- 
2.39.2




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

end of thread, other threads:[~2023-06-13  8:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 12:59 [PATCH] asm: align virt_to_phys definitions Ahmad Fatoum
2023-06-13  8:37 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox