[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH 46/88] hw/display/vga: use g_new() family of funct
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-trivial] [PATCH 46/88] hw/display/vga: use g_new() family of functions |
Date: |
Fri, 6 Oct 2017 20:49:41 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
Gerd: should those files go under Graphics section in MAINTAINERS?
hw/display/vga-isa-mm.c | 6 +++---
hw/display/vga.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/display/vga-isa-mm.c b/hw/display/vga-isa-mm.c
index 51ccbccc41..7af72864df 100644
--- a/hw/display/vga-isa-mm.c
+++ b/hw/display/vga-isa-mm.c
@@ -105,12 +105,12 @@ static void vga_mm_init(ISAVGAMMState *s, hwaddr
vram_base,
MemoryRegion *s_ioport_ctrl, *vga_io_memory;
s->it_shift = it_shift;
- s_ioport_ctrl = g_malloc(sizeof(*s_ioport_ctrl));
+ s_ioport_ctrl = g_new(MemoryRegion, 1);
memory_region_init_io(s_ioport_ctrl, NULL, &vga_mm_ctrl_ops, s,
"vga-mm-ctrl", 0x100000);
memory_region_set_flush_coalesced(s_ioport_ctrl);
- vga_io_memory = g_malloc(sizeof(*vga_io_memory));
+ vga_io_memory = g_new(MemoryRegion, 1);
/* XXX: endianness? */
memory_region_init_io(vga_io_memory, NULL, &vga_mem_ops, &s->vga,
"vga-mem", 0x20000);
@@ -130,7 +130,7 @@ int isa_vga_mm_init(hwaddr vram_base,
{
ISAVGAMMState *s;
- s = g_malloc0(sizeof(*s));
+ s = g_new0(ISAVGAMMState, 1);
s->vga.vram_size_mb = VGA_RAM_SIZE >> 20;
vga_common_init(&s->vga, NULL, true);
diff --git a/hw/display/vga.c b/hw/display/vga.c
index ed24ef7076..bdefa60f30 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -2236,7 +2236,7 @@ MemoryRegion *vga_init_io(VGACommonState *s, Object *obj,
*vga_ports = vga_portio_list;
*vbe_ports = vbe_portio_list;
- vga_mem = g_malloc(sizeof(*vga_mem));
+ vga_mem = g_new(MemoryRegion, 1);
memory_region_init_io(vga_mem, obj, &vga_mem_ops, s,
"vga-lowmem", 0x20000);
memory_region_set_flush_coalesced(vga_mem);
--
2.14.2
- [Qemu-trivial] [PATCH 38/88] VFIO: use g_new() family of functions, (continued)
- [Qemu-trivial] [PATCH 38/88] VFIO: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 39/88] hw/i386: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 40/88] hw/xen: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 42/88] XTFPGA: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 41/88] target/i386: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 43/88] hw/core: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 44/88] hw/core/loader: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 45/88] hw/display: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 46/88] hw/display/vga: use g_new() family of functions,
Philippe Mathieu-Daudé <=
- [Qemu-trivial] [PATCH 47/88] hw/i2c: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 48/88] hw/input: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 49/88] hw/misc: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 50/88] ivshmem: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 51/88] hw/timer: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 52/88] i.MX31: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 53/88] iSCSI: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06