hw/sh4: Use memory_region_init_rom() with read-only regions
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 24 Feb 2020 18:51:24 +0000 (19:51 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Mar 2020 14:18:47 +0000 (15:18 +0100)
This commit was produced with the Coccinelle script
scripts/coccinelle/memory-region-housekeeping.cocci.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/sh4/shix.c

index 68b14ee5e70a41ee6c1b3a3be416167c2522c955..f410c088836a7c3bc109778fbdeb087edb0f1ef4 100644 (file)
@@ -53,8 +53,7 @@ static void shix_init(MachineState *machine)
     cpu = SUPERH_CPU(cpu_create(machine->cpu_type));
 
     /* Allocate memory space */
-    memory_region_init_ram(rom, NULL, "shix.rom", 0x4000, &error_fatal);
-    memory_region_set_readonly(rom, true);
+    memory_region_init_rom(rom, NULL, "shix.rom", 0x4000, &error_fatal);
     memory_region_add_subregion(sysmem, 0x00000000, rom);
     memory_region_init_ram(&sdram[0], NULL, "shix.sdram1", 0x01000000,
                            &error_fatal);