system/memory: Constify various AddressSpace arguments (notify)
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-4-philmd@oss.qualcomm.com>
Philippe Mathieu-Daudé committed
Mar 19, 2026 at 13:29 UTC
e8d053f4de709a4e984cc57c57ad5f0e9612f9ae
3 files changed
+5
-5
include/system/memory.h
+1
-1
@@ -2703,7 +2703,7 @@ void address_space_destroy_free(AddressSpace *as);
2703
*
2704
* @as: an initialized #AddressSpace
2705
*/
2706
-void address_space_remove_listeners(AddressSpace *as);
2706
+void address_space_remove_listeners(const AddressSpace *as);
2707
2708
/**
2709
* address_space_rw: read from or write to an address space.
system/memory.c
+3
-3
@@ -3009,7 +3009,7 @@ void memory_global_dirty_log_stop(unsigned int flags)
3009
}
3010
3011
static void listener_add_address_space(MemoryListener *listener,
3012
- AddressSpace *as)
3012
+ const AddressSpace *as)
3013
{
3014
unsigned i;
3015
FlatView *view;
@@ -3074,7 +3074,7 @@ static void listener_add_address_space(MemoryListener *listener,
3074
}
3075
3076
static void listener_del_address_space(MemoryListener *listener,
3077
- AddressSpace *as)
3077
+ const AddressSpace *as)
3078
{
3079
unsigned i;
3080
FlatView *view;
@@ -3179,7 +3179,7 @@ void memory_listener_unregister(MemoryListener *listener)
3179
listener->address_space = NULL;
3180
}
3181
3182
-void address_space_remove_listeners(AddressSpace *as)
3182
+void address_space_remove_listeners(const AddressSpace *as)
3183
{
3184
while (!QTAILQ_EMPTY(&as->listeners)) {
3185
memory_listener_unregister(QTAILQ_FIRST(&as->listeners));
system/physmem.c
+1
-1
@@ -3565,7 +3565,7 @@ address_space_unregister_map_client_do(AddressSpaceMapClient *client)
3565
g_free(client);
3566
}
3567
3568
-static void address_space_notify_map_clients_locked(AddressSpace *as)
3568
+static void address_space_notify_map_clients_locked(const AddressSpace *as)
3569
{
3570
AddressSpaceMapClient *client;
3571