[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/24] hw/dma/pxa2xx: Remove superfluous memset
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 11/24] hw/dma/pxa2xx: Remove superfluous memset |
Date: |
Fri, 6 Nov 2015 15:43:48 +0300 |
From: Thomas Huth <address@hidden>
g_malloc0 already clears the memory, so no need for
the additional memset here. And while we're at it,
also convert the g_malloc0 to the preferred g_new0.
Signed-off-by: Thomas Huth <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
hw/dma/pxa2xx_dma.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c
index d4501fb..54cdb25 100644
--- a/hw/dma/pxa2xx_dma.c
+++ b/hw/dma/pxa2xx_dma.c
@@ -459,9 +459,8 @@ static int pxa2xx_dma_init(SysBusDevice *sbd)
return -1;
}
- s->chan = g_malloc0(sizeof(PXA2xxDMAChannel) * s->channels);
+ s->chan = g_new0(PXA2xxDMAChannel, s->channels);
- memset(s->chan, 0, sizeof(PXA2xxDMAChannel) * s->channels);
for (i = 0; i < s->channels; i ++)
s->chan[i].state = DCSR_STOPINTR;
--
2.1.4
- [Qemu-devel] [PULL 00/24] Trivial patches for 2015-11-06, Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 09/24] tests/i44fx-test: No need for zeroing memory before memset, Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 10/24] linux-user/syscall: Replace g_malloc0 + memcpy with g_memdup, Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 01/24] hw/acpi/aml-build: remove useless glib version check, Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 06/24] tests: ignore test-qga, Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 08/24] hw/input/tsc210x: Remove superfluous memset, Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 11/24] hw/dma/pxa2xx: Remove superfluous memset,
Michael Tokarev <=
- [Qemu-devel] [PULL 02/24] gdbstub: Fix buffer overflows in gdb_handle_packet(), Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 23/24] qemu-sockets: do not test path with access() before unlinking, Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 20/24] target-alpha: fix uninitialized variable, Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 17/24] qom/object: fix 2 comment typos, Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 16/24] configure: remove help string for 'vnc-tls' option, Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 03/24] hw/display/tcx: Remove superfluous OBJECT() typecasts, Michael Tokarev, 2015/11/06
- [Qemu-devel] [PULL 13/24] ui: Use g_new() & friends where that makes obvious sense, Michael Tokarev, 2015/11/06