[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 06/25] hw/display: Use memory_region_init_rom() with read-only
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 06/25] hw/display: Use memory_region_init_rom() with read-only regions |
Date: |
Mon, 16 Mar 2020 19:49:47 +0100 |
This commit was produced with the Coccinelle script
scripts/coccinelle/memory-region-housekeeping.cocci.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/display/cg3.c | 5 ++---
hw/display/tcx.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/display/cg3.c b/hw/display/cg3.c
index 4fb67c6b1c..a1ede10394 100644
--- a/hw/display/cg3.c
+++ b/hw/display/cg3.c
@@ -287,9 +287,8 @@ static void cg3_initfn(Object *obj)
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
CG3State *s = CG3(obj);
- memory_region_init_ram_nomigrate(&s->rom, obj, "cg3.prom",
FCODE_MAX_ROM_SIZE,
- &error_fatal);
- memory_region_set_readonly(&s->rom, true);
+ memory_region_init_rom_nomigrate(&s->rom, obj, "cg3.prom",
+ FCODE_MAX_ROM_SIZE, &error_fatal);
sysbus_init_mmio(sbd, &s->rom);
memory_region_init_io(&s->reg, obj, &cg3_reg_ops, s, "cg3.reg",
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index ca458f94fe..76de16e8ea 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -755,9 +755,8 @@ static void tcx_initfn(Object *obj)
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
TCXState *s = TCX(obj);
- memory_region_init_ram_nomigrate(&s->rom, obj, "tcx.prom",
FCODE_MAX_ROM_SIZE,
- &error_fatal);
- memory_region_set_readonly(&s->rom, true);
+ memory_region_init_rom_nomigrate(&s->rom, obj, "tcx.prom",
+ FCODE_MAX_ROM_SIZE, &error_fatal);
sysbus_init_mmio(sbd, &s->rom);
/* 2/STIP : Stippler */
--
2.21.1
- [PATCH v3 17/25] hw/core: Let devices own the MemoryRegion they create, (continued)
- [PATCH v3 17/25] hw/core: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 18/25] hw/display: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 19/25] hw/dma: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 20/25] hw/riscv: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 21/25] hw/char: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 22/25] hw/arm/stm32: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 24/25] hw/arm: Remove unnecessary memory_region_set_readonly() on ROM alias, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 23/25] hw/ppc/ppc405: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 25/25] hw/arm: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 06/25] hw/display: Use memory_region_init_rom() with read-only regions,
Philippe Mathieu-Daudé <=
- Re: [PATCH v3 00/25] hw: Sanitize various MemoryRegion calls, Aleksandar Markovic, 2020/03/16