Mark the AddressSpace structure const when it is only accessed read-only.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
 include/system/memory.h | 5 +++--
 system/physmem.c        | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/system/memory.h b/include/system/memory.h
index 1417132f6d9..858dc40dc5f 100644
--- a/include/system/memory.h
+++ b/include/system/memory.h
@@ -2829,7 +2829,8 @@ static inline MemoryRegion 
*address_space_translate(AddressSpace *as,
  * @is_write: indicates the transfer direction
  * @attrs: memory attributes
  */
-bool address_space_access_valid(AddressSpace *as, hwaddr addr, hwaddr len,
+bool address_space_access_valid(const AddressSpace *as,
+                                hwaddr addr, hwaddr len,
                                 bool is_write, MemTxAttrs attrs);
 
 /**
@@ -2839,7 +2840,7 @@ bool address_space_access_valid(AddressSpace *as, hwaddr 
addr, hwaddr len,
  * @as: #AddressSpace to be accessed
  * @addr: address within that address space
  */
-bool address_space_is_io(AddressSpace *as, hwaddr addr);
+bool address_space_is_io(const AddressSpace *as, hwaddr addr);
 
 /* address_space_map: map a physical memory region into a host virtual address
  *
diff --git a/system/physmem.c b/system/physmem.c
index 4e26f1a1d42..23ea6b69255 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -3652,7 +3652,7 @@ static bool flatview_access_valid(FlatView *fv, hwaddr 
addr, hwaddr len,
     return true;
 }
 
-bool address_space_access_valid(AddressSpace *as, hwaddr addr,
+bool address_space_access_valid(const AddressSpace *as, hwaddr addr,
                                 hwaddr len, bool is_write,
                                 MemTxAttrs attrs)
 {
@@ -3663,7 +3663,7 @@ bool address_space_access_valid(AddressSpace *as, hwaddr 
addr,
     return flatview_access_valid(fv, addr, len, is_write, attrs);
 }
 
-bool address_space_is_io(AddressSpace *as, hwaddr addr)
+bool address_space_is_io(const AddressSpace *as, hwaddr addr)
 {
     MemoryRegion *mr;
 
-- 
2.53.0


Reply via email to