hw/arm/stm32: Use memory_region_init_rom() with read-only regions
commit30ade0c41653e94954971921d2ebeb25e5a206db
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 24 Feb 2020 15:58:53 +0000 (24 16:58 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Mar 2020 14:18:49 +0000 (17 15:18 +0100)
treea27e8f24c9dd0ea97ce62ee1f0bdad87731c85ac
parent41e82da57dbb6cad8ef1c9a281a9aac2265a0586
hw/arm/stm32: Use memory_region_init_rom() with read-only regions

The scripts/coccinelle/memory-region-housekeeping.cocci reported:
* TODO [[view:./hw/arm/stm32f205_soc.c::face=ovl-face1::linb=96::colb=4::cole=26][potential use of memory_region_init_rom*() in  ./hw/arm/stm32f205_soc.c::96]]
* TODO [[view:./hw/arm/stm32f405_soc.c::face=ovl-face1::linb=98::colb=4::cole=26][potential use of memory_region_init_rom*() in  ./hw/arm/stm32f405_soc.c::98]]

We can indeed replace the memory_region_init_ram() and
memory_region_set_readonly() calls by memory_region_init_rom().

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/arm/stm32f205_soc.c
hw/arm/stm32f405_soc.c