]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
system/memory: Constify various AddressSpace arguments (checks)
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 19 Mar 2026 12:28:13 +0000 (13:28 +0100)
committerPhilippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Thu, 18 Jun 2026 12:27:04 +0000 (14:27 +0200)
Mark the AddressSpace structure const when it is only accessed
read-only.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020359.18627-2-philmd@oss.qualcomm.com>

include/system/memory.h
system/physmem.c

index 9cd17847ab008f473ca9b05df7c3d2f833ea28ac..3acaa309755c1bddf56cc8ce2437211c904701d2 100644 (file)
@@ -2850,7 +2850,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);
 
 /**
index 7bcbf8757361fb42cd688441a7b6bc871e506250..a0561177afd3771931715a459e90f4468325cd7c 100644 (file)
@@ -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)
 {