[PATCH 4/7] hexagon: asm/io.h: Expect immutable pointer in virt_to_phys prototype

From: Stanislav Kinsburskii
Date: Thu Apr 27 2023 - 13:42:48 EST


From: Stanislav Kinsburskii <stanislav.kinsburskii@xxxxxxxxx>

These helper function - virt_to_phys - doesn't need the address pointer to
be mutable.

In the same time expecting it to be mutable leads to the following build
warning for constant pointers:

warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type

Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@xxxxxxxxx>
CC: Brian Cain <bcain@xxxxxxxxxxx>
CC: Linus Walleij <linus.walleij@xxxxxxxxxx>
CC: Mark Brown <broonie@xxxxxxxxxx>
CC: linux-hexagon@xxxxxxxxxxxxxxx
CC: linux-kernel@xxxxxxxxxxxxxxx
---
arch/hexagon/include/asm/io.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h
index 46a099de85b7..facbd7467dd3 100644
--- a/arch/hexagon/include/asm/io.h
+++ b/arch/hexagon/include/asm/io.h
@@ -46,7 +46,7 @@ extern void __raw_writesl(void __iomem *addr, const void *data, int wordlen);
* virt_to_phys - map virtual address to physical
* @address: address to map
*/
-static inline unsigned long virt_to_phys(volatile void *address)
+static inline unsigned long virt_to_phys(const volatile void *address)
{
return __pa(address);
}