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]> Reviewed-by: Richard Henderson <[email protected]> Message-Id: <[email protected]> --- include/system/memory.h | 2 +- system/memory.c | 6 +++--- system/physmem.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/system/memory.h b/include/system/memory.h index 3acaa309755..7ecad33130c 100644 --- a/include/system/memory.h +++ b/include/system/memory.h @@ -2703,7 +2703,7 @@ void address_space_destroy_free(AddressSpace *as); * * @as: an initialized #AddressSpace */ -void address_space_remove_listeners(AddressSpace *as); +void address_space_remove_listeners(const AddressSpace *as); /** * address_space_rw: read from or write to an address space. diff --git a/system/memory.c b/system/memory.c index 93c714104b2..8436668c181 100644 --- a/system/memory.c +++ b/system/memory.c @@ -3009,7 +3009,7 @@ void memory_global_dirty_log_stop(unsigned int flags) } static void listener_add_address_space(MemoryListener *listener, - AddressSpace *as) + const AddressSpace *as) { unsigned i; FlatView *view; @@ -3074,7 +3074,7 @@ static void listener_add_address_space(MemoryListener *listener, } static void listener_del_address_space(MemoryListener *listener, - AddressSpace *as) + const AddressSpace *as) { unsigned i; FlatView *view; @@ -3179,7 +3179,7 @@ void memory_listener_unregister(MemoryListener *listener) listener->address_space = NULL; } -void address_space_remove_listeners(AddressSpace *as) +void address_space_remove_listeners(const AddressSpace *as) { while (!QTAILQ_EMPTY(&as->listeners)) { memory_listener_unregister(QTAILQ_FIRST(&as->listeners)); diff --git a/system/physmem.c b/system/physmem.c index a0561177afd..e8a2c438c7d 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3565,7 +3565,7 @@ address_space_unregister_map_client_do(AddressSpaceMapClient *client) g_free(client); } -static void address_space_notify_map_clients_locked(AddressSpace *as) +static void address_space_notify_map_clients_locked(const AddressSpace *as) { AddressSpaceMapClient *client; -- 2.53.0
