From patchwork Fri Oct 9 15:56:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 528491 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:4830:134:3::10]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D1E26140E3F for ; Sat, 10 Oct 2015 13:02:51 +1100 (AEDT) Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkjUj-0000AJ-0a for incoming@patchwork.ozlabs.org; Fri, 09 Oct 2015 22:02:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zkciv-0005Pd-O3 for incoming@patchwork.ozlabs.org; Fri, 09 Oct 2015 14:48:57 -0400 Received: from localhost ([::1]:41354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkcOj-0005HQ-Nf for incoming@patchwork.ozlabs.org; Fri, 09 Oct 2015 14:28:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zka2I-0006j0-G9 for qemu-devel@nongnu.org; Fri, 09 Oct 2015 11:56:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zka2F-00057h-NA for qemu-devel@nongnu.org; Fri, 09 Oct 2015 11:56:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zka2E-00053A-DS; Fri, 09 Oct 2015 11:56:42 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0EB7A550CD; Fri, 9 Oct 2015 15:56:42 +0000 (UTC) Received: from thh440s.redhat.com (vpn1-4-95.ams2.redhat.com [10.36.4.95]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t99Fud3K025235; Fri, 9 Oct 2015 11:56:41 -0400 From: Thomas Huth To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Fri, 9 Oct 2015 17:56:35 +0200 Message-Id: <1444406198-6521-2-git-send-email-thuth@redhat.com> In-Reply-To: <1444406198-6521-1-git-send-email-thuth@redhat.com> References: <1444406198-6521-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x Subject: [Qemu-devel] [PATCH v2 1/4] hw/dma/pxa2xx: Remove superfluous memset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 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 --- 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;