]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/dma/pxa2xx: Remove superfluous memset
authorThomas Huth <thuth@redhat.com>
Fri, 9 Oct 2015 15:56:35 +0000 (17:56 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 6 Nov 2015 12:42:38 +0000 (15:42 +0300)
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 <thuth@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/dma/pxa2xx_dma.c

index d4501fb4cbfc39c14fbe8cc7eb247fe06bbf6822..54cdb25a32c8975d6a1c74438cef070643cf7ce7 100644 (file)
@@ -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;