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]> --- 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 5c525646193..fbb4166008a 100644 --- a/include/system/memory.h +++ b/include/system/memory.h @@ -2682,7 +2682,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 ea2ce80cf2c..f58fae67fa1 100644 --- a/system/memory.c +++ b/system/memory.c @@ -2985,7 +2985,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; @@ -3050,7 +3050,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; @@ -3155,7 +3155,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
