@samitouri / QOSamiQemu / commits / 5825543f61

system/memory: Constify various AddressSpace arguments (flat-range)

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-3-philmd@oss.qualcomm.com>

Philippe Mathieu-Daudé committed Mar 19, 2026 at 13:29 UTC 5825543f61bc7e1ae6932080575dbb0dd3e029f6
1 file changed +6 -4
system/memory.c
+6 -4
@@ -889,7 +889,8 @@ static void address_space_update_ioeventfds(AddressSpace *as)
889 * range `cmr'. Only the part that has intersection of the specified
890 * FlatRange will be sent.
891 */
892 -static void flat_range_coalesced_io_notify(FlatRange *fr, AddressSpace *as,
892 +static void flat_range_coalesced_io_notify(FlatRange *fr,
893 + const AddressSpace *as,
894 CoalescedMemoryRange *cmr, bool add)
895 {
896 AddrRange tmp;
@@ -913,7 +914,7 @@ static void flat_range_coalesced_io_notify(FlatRange *fr, AddressSpace *as,
914 }
915 }
916
916 -static void flat_range_coalesced_io_del(FlatRange *fr, AddressSpace *as)
917 +static void flat_range_coalesced_io_del(FlatRange *fr, const AddressSpace *as)
918 {
919 CoalescedMemoryRange *cmr;
920
@@ -922,7 +923,7 @@ static void flat_range_coalesced_io_del(FlatRange *fr, AddressSpace *as)
923 }
924 }
925
925 -static void flat_range_coalesced_io_add(FlatRange *fr, AddressSpace *as)
926 +static void flat_range_coalesced_io_add(FlatRange *fr, const AddressSpace *as)
927 {
928 MemoryRegion *mr = fr->mr;
929 CoalescedMemoryRange *cmr;
@@ -940,7 +941,8 @@ static void
941 flat_range_coalesced_io_notify_listener_add_del(FlatRange *fr,
942 MemoryRegionSection *mrs,
943 MemoryListener *listener,
943 - AddressSpace *as, bool add)
944 + const AddressSpace *as,
945 + bool add)
946 {
947 CoalescedMemoryRange *cmr;
948 MemoryRegion *mr = fr->mr;