From: Thomas Huth Date: Fri, 9 Oct 2015 15:56:35 +0000 (+0200) Subject: hw/dma/pxa2xx: Remove superfluous memset X-Git-Tag: TizenStudio_2.0_p2.3.2~120^2~1^2~87^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a13b27273cdc4f6fd18bc1e83950d47c6b5928b;p=sdk%2Femulator%2Fqemu.git hw/dma/pxa2xx: Remove superfluous memset 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 Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- 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;