From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkIIc-0008Jm-HE for qemu-devel@nongnu.org; Thu, 08 Oct 2015 17:00:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkIIE-0003HT-F0 for qemu-devel@nongnu.org; Thu, 08 Oct 2015 17:00:26 -0400 References: <1444332916-16476-1-git-send-email-thuth@redhat.com> <1444332916-16476-2-git-send-email-thuth@redhat.com> From: Eric Blake Message-ID: <5616D94C.4040109@redhat.com> Date: Thu, 8 Oct 2015 14:59:56 -0600 MIME-Version: 1.0 In-Reply-To: <1444332916-16476-2-git-send-email-thuth@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tO8sekbXI6hEVrVSMnBqxMKBGOCawfG51" Subject: Re: [Qemu-devel] [PATCH 1/5] hw/dma/pxa2xx: Remove superfluous memset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tO8sekbXI6hEVrVSMnBqxMKBGOCawfG51 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/08/2015 01:35 PM, Thomas Huth wrote: > g_malloc0 already clears the memory, so no need for > the additional memset here. >=20 > Signed-off-by: Thomas Huth > --- > hw/dma/pxa2xx_dma.c | 1 - > 1 file changed, 1 deletion(-) >=20 > diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c > index d4501fb..3f0a720 100644 > --- a/hw/dma/pxa2xx_dma.c > +++ b/hw/dma/pxa2xx_dma.c > @@ -461,7 +461,6 @@ static int pxa2xx_dma_init(SysBusDevice *sbd) > =20 > s->chan =3D g_malloc0(sizeof(PXA2xxDMAChannel) * s->channels); As long as we're here, this should probably be switched to g_new0(), in part to avoid any chance that the multiply can overflow. > =20 > - memset(s->chan, 0, sizeof(PXA2xxDMAChannel) * s->channels); But this part is correct. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --tO8sekbXI6hEVrVSMnBqxMKBGOCawfG51 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWFtlQAAoJEKeha0olJ0NqGKcIAJNlM5SmvR1bRfXY4FCvp4d7 qDZuXMn4Wv5uUayOgc7lBbjfXV2ZMD4L9QQACdeGSy08udFRvXN/b8b5CdBeUTLU JZg3XDYL58w0tBPtc33ppAA3KqU+5BWWj5Kkqq08C10twgL8zGO5yYVxGB1T/g6H jgRHaDgEYWyuL3P6Oh+A9nJOu8smgfMgbkPecwFZTpH55bJiULZyinnJHJTOfnOt od7ipmFzuv02KyNLAMJFwFliu3gY6yZAB0t+K3tuJCVd2Do04jwmNdJmmfTP0HC5 sukjI0jIM7s3ti19D/mB07RRvdQNhxXvf3agsl+Ab2Fg25qizRFvePrM/d12ZSI= =6Eph -----END PGP SIGNATURE----- --tO8sekbXI6hEVrVSMnBqxMKBGOCawfG51--