hwaccess: Constify `addr` argument of MMIO read functions
Change-Id: I1419241a8332b74103b3921df2c615bdf91346a7
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18881
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Youness Alaoui <snifikino@gmail.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
diff --git a/hwaccess.c b/hwaccess.c
index 1901ee6..aede7e3 100644
--- a/hwaccess.c
+++ b/hwaccess.c
@@ -147,22 +147,22 @@
sync_primitive();
}
-uint8_t mmio_readb(void *addr)
+uint8_t mmio_readb(const void *addr)
{
- return *(volatile uint8_t *) addr;
+ return *(volatile const uint8_t *) addr;
}
-uint16_t mmio_readw(void *addr)
+uint16_t mmio_readw(const void *addr)
{
- return *(volatile uint16_t *) addr;
+ return *(volatile const uint16_t *) addr;
}
-uint32_t mmio_readl(void *addr)
+uint32_t mmio_readl(const void *addr)
{
- return *(volatile uint32_t *) addr;
+ return *(volatile const uint32_t *) addr;
}
-void mmio_readn(void *addr, uint8_t *buf, size_t len)
+void mmio_readn(const void *addr, uint8_t *buf, size_t len)
{
memcpy(buf, addr, len);
return;
@@ -183,17 +183,17 @@
mmio_writel(cpu_to_le32(val), addr);
}
-uint8_t mmio_le_readb(void *addr)
+uint8_t mmio_le_readb(const void *addr)
{
return le_to_cpu8(mmio_readb(addr));
}
-uint16_t mmio_le_readw(void *addr)
+uint16_t mmio_le_readw(const void *addr)
{
return le_to_cpu16(mmio_readw(addr));
}
-uint32_t mmio_le_readl(void *addr)
+uint32_t mmio_le_readl(const void *addr)
{
return le_to_cpu32(mmio_readl(addr));
}