From: Philippe Mathieu-Daudé <[email protected]>

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

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

diff --git a/include/system/memory.h b/include/system/memory.h
index 1417132f6d9..5c525646193 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);
 
 /**
diff --git a/system/physmem.c b/system/physmem.c
index 7bcbf875736..a0561177afd 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -3646,7 +3646,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)
 {
-- 
2.53.0


Reply via email to