qemu-e2k/hw/display
Markus Armbruster b45c03f585 arm: Use g_new() & friends where that makes obvious sense
g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
for two reasons.  One, it catches multiplication overflowing size_t.
Two, it returns T * rather than void *, which lets the compiler catch
more type errors.

This commit only touches allocations with size arguments of the form
sizeof(T).

Coccinelle semantic patch:

    @@
    type T;
    @@
    -g_malloc(sizeof(T))
    +g_new(T, 1)
    @@
    type T;
    @@
    -g_try_malloc(sizeof(T))
    +g_try_new(T, 1)
    @@
    type T;
    @@
    -g_malloc0(sizeof(T))
    +g_new0(T, 1)
    @@
    type T;
    @@
    -g_try_malloc0(sizeof(T))
    +g_try_new0(T, 1)
    @@
    type T;
    expression n;
    @@
    -g_malloc(sizeof(T) * (n))
    +g_new(T, n)
    @@
    type T;
    expression n;
    @@
    -g_try_malloc(sizeof(T) * (n))
    +g_try_new(T, n)
    @@
    type T;
    expression n;
    @@
    -g_malloc0(sizeof(T) * (n))
    +g_new0(T, n)
    @@
    type T;
    expression n;
    @@
    -g_try_malloc0(sizeof(T) * (n))
    +g_try_new0(T, n)
    @@
    type T;
    expression p, n;
    @@
    -g_realloc(p, sizeof(T) * (n))
    +g_renew(T, p, n)
    @@
    type T;
    expression p, n;
    @@
    -g_try_realloc(p, sizeof(T) * (n))
    +g_try_renew(T, p, n)
    @@
    type T;
    expression n;
    @@
    -(T *)g_new(T, n)
    +g_new(T, n)
    @@
    type T;
    expression n;
    @@
    -(T *)g_new0(T, n)
    +g_new0(T, n)
    @@
    type T;
    expression p, n;
    @@
    -(T *)g_renew(T, p, n)
    +g_renew(T, p, n)

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1440524394-15640-1-git-send-email-armbru@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-09-07 10:39:27 +01:00
..
ads7846.c
blizzard_template.h
blizzard.c blizzard: do not depend on VGA internals 2015-01-15 10:44:13 +03:00
cg3.c hw/display/cg3.c: Fix memory leak 2015-06-23 20:23:39 +03:00
cirrus_vga_rop2.h
cirrus_vga_rop.h
cirrus_vga.c cirrus_vga: QOMify 2015-05-19 11:40:01 +02:00
exynos4210_fimd.c hw/display/exynos4210_fimd: Fix bit-swapping code 2015-06-15 18:06:08 +01:00
framebuffer.c framebuffer: set DIRTY_MEMORY_VGA on RAM that is used for the framebuffer 2015-07-24 13:57:45 +02:00
framebuffer.h framebuffer: set DIRTY_MEMORY_VGA on RAM that is used for the framebuffer 2015-07-24 13:57:45 +02:00
g364fb.c qerror: Move #include out of qerror.h 2015-06-22 18:20:40 +02:00
jazz_led.c
Makefile.objs virtio-vga: add virtio gpu device with vga compatibility 2015-06-12 10:13:23 +02:00
milkymist-tmu2.c
milkymist-vgafb_template.h
milkymist-vgafb.c framebuffer: set DIRTY_MEMORY_VGA on RAM that is used for the framebuffer 2015-07-24 13:57:45 +02:00
omap_dss.c arm: Use g_new() & friends where that makes obvious sense 2015-09-07 10:39:27 +01:00
omap_lcd_template.h
omap_lcdc.c arm: Use g_new() & friends where that makes obvious sense 2015-09-07 10:39:27 +01:00
pl110_template.h
pl110.c framebuffer: set DIRTY_MEMORY_VGA on RAM that is used for the framebuffer 2015-07-24 13:57:45 +02:00
pxa2xx_lcd.c framebuffer: set DIRTY_MEMORY_VGA on RAM that is used for the framebuffer 2015-07-24 13:57:45 +02:00
pxa2xx_template.h
qxl-logger.c hw/display/qxl-logger.c: Constify some variable 2015-06-23 20:23:39 +03:00
qxl-render.c
qxl.c qxl: Fix new function name for spice-server library 2015-07-22 16:38:42 +02:00
qxl.h qxl: allow to specify head limit to qxl driver 2015-07-16 17:31:05 +02:00
sm501_template.h
sm501.c display: add memory_region_sync_dirty_bitmap calls 2015-06-05 17:09:58 +02:00
ssd0303.c
ssd0323.c
tc6393xb_template.h
tc6393xb.c hw/display/tc6393xb.c: Fix misusing qemu_allocate_irqs for single irq 2015-06-03 14:21:24 +03:00
tcx.c hw/display/tcx.c: Fix memory leak 2015-06-23 20:23:39 +03:00
vga_int.h virtio-vga: add virtio gpu device with vga compatibility 2015-06-12 10:13:23 +02:00
vga-helpers.h
vga-isa-mm.c
vga-isa.c isa: remove isa_mem_base variable 2015-02-13 14:09:28 +00:00
vga-pci.c virtio-vga: add virtio gpu device with vga compatibility 2015-06-12 10:13:23 +02:00
vga.c migration: Use normal VMStateDescriptions for Subsections 2015-06-12 06:53:57 +02:00
vga.h
virtio-gpu-pci.c virtio-gpu: use virtio_instance_init_common, fixup properties 2015-07-07 11:23:18 +02:00
virtio-gpu.c virtio: get_features() can fail 2015-07-27 18:11:53 +03:00
virtio-vga.c virtio-gpu: use virtio_instance_init_common, fixup properties 2015-07-07 11:23:18 +02:00
vmware_vga.c memory: differentiate memory_region_is_logging and memory_region_get_dirty_log_mask 2015-06-05 17:09:58 +02:00
xenfb.c Add tracing to xenfb. 2015-02-10 09:27:19 +03:00