From: Philippe Mathieu-Daudé Date: Thu, 19 Mar 2026 12:28:13 +0000 (+0100) Subject: system/memory: Constify various AddressSpace arguments (checks) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ff7ebb3d5ecc0fb471f4ea2c74b7cf9de709c231;p=thirdparty%2Fqemu.git 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é Reviewed-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20260616020359.18627-2-philmd@oss.qualcomm.com> --- diff --git a/include/system/memory.h b/include/system/memory.h index 9cd17847ab..3acaa30975 100644 --- a/include/system/memory.h +++ b/include/system/memory.h @@ -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); /** diff --git a/system/physmem.c b/system/physmem.c index 7bcbf87573..a0561177af 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) {