system/memory: Constify various AddressSpace arguments (checks)
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>
Philippe Mathieu-Daudé committed
Mar 19, 2026 at 13:28 UTC
ff7ebb3d5ecc0fb471f4ea2c74b7cf9de709c231
2 files changed
+3
-2
include/system/memory.h
+2
-1
@@ -2850,7 +2850,8 @@ static inline MemoryRegion *address_space_translate(AddressSpace *as,
2850
* @is_write: indicates the transfer direction
2851
* @attrs: memory attributes
2852
*/
2853
-bool address_space_access_valid(AddressSpace *as, hwaddr addr, hwaddr len,
2853
+bool address_space_access_valid(const AddressSpace *as,
2854
+ hwaddr addr, hwaddr len,
2855
bool is_write, MemTxAttrs attrs);
2856
2857
/**
system/physmem.c
+1
-1
@@ -3646,7 +3646,7 @@ static bool flatview_access_valid(FlatView *fv, hwaddr addr, hwaddr len,
3646
return true;
3647
}
3648
3649
-bool address_space_access_valid(AddressSpace *as, hwaddr addr,
3649
+bool address_space_access_valid(const AddressSpace *as, hwaddr addr,
3650
hwaddr len, bool is_write,
3651
MemTxAttrs attrs)
3652
{