Skip to content

Commit

Permalink
hw/dma/pxa2xx: Remove superfluous memset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
huth authored and Michael Tokarev committed Nov 6, 2015
1 parent e9d49d5 commit 1a13b27
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hw/dma/pxa2xx_dma.c
Expand Up @@ -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;

Expand Down

0 comments on commit 1a13b27

Please sign in to comment.