mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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>
This commit is contained in:
parent
41e82da57d
commit
30ade0c416
2 changed files with 2 additions and 6 deletions
|
@ -93,12 +93,10 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
|
|||
MemoryRegion *flash = g_new(MemoryRegion, 1);
|
||||
MemoryRegion *flash_alias = g_new(MemoryRegion, 1);
|
||||
|
||||
memory_region_init_ram(flash, NULL, "STM32F205.flash", FLASH_SIZE,
|
||||
memory_region_init_rom(flash, NULL, "STM32F205.flash", FLASH_SIZE,
|
||||
&error_fatal);
|
||||
memory_region_init_alias(flash_alias, NULL, "STM32F205.flash.alias",
|
||||
flash, 0, FLASH_SIZE);
|
||||
|
||||
memory_region_set_readonly(flash, true);
|
||||
memory_region_set_readonly(flash_alias, true);
|
||||
|
||||
memory_region_add_subregion(system_memory, FLASH_BASE_ADDRESS, flash);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue