From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkgcO-0004W2-DN for qemu-devel@nongnu.org; Fri, 09 Oct 2015 18:58:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkgcM-0007ob-Qq for qemu-devel@nongnu.org; Fri, 09 Oct 2015 18:58:28 -0400 References: <1444406198-6521-1-git-send-email-thuth@redhat.com> <1444406198-6521-2-git-send-email-thuth@redhat.com> From: Eric Blake Message-ID: <5618468D.5010005@redhat.com> Date: Fri, 9 Oct 2015 16:58:21 -0600 MIME-Version: 1.0 In-Reply-To: <1444406198-6521-2-git-send-email-thuth@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BIHIcAOlkarhJXAFL1bc4cuXBdbdhvbNV" Subject: Re: [Qemu-devel] [PATCH v2 1/4] 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, qemu-trivial@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BIHIcAOlkarhJXAFL1bc4cuXBdbdhvbNV Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/09/2015 09:56 AM, Thomas Huth wrote: > 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. >=20 > Signed-off-by: Thomas Huth > --- > hw/dma/pxa2xx_dma.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Reviewed-by: Eric Blake >=20 > 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; > } > =20 > - s->chan =3D g_malloc0(sizeof(PXA2xxDMAChannel) * s->channels); > + s->chan =3D g_new0(PXA2xxDMAChannel, s->channels); > =20 > - memset(s->chan, 0, sizeof(PXA2xxDMAChannel) * s->channels); > for (i =3D 0; i < s->channels; i ++) > s->chan[i].state =3D DCSR_STOPINTR; > =20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --BIHIcAOlkarhJXAFL1bc4cuXBdbdhvbNV 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/ iQEcBAEBCAAGBQJWGEaNAAoJEKeha0olJ0Nq4FsIAJKauu/mmDHTDEN/2FgTD/nH auImLycQkkwHIA0zsXwbwFWqVDYJQXUaAAqzIqMmqqJD+bFQAmHNRZR3i9aRxgfR M+K4XF+CiAa9XOAhez5UXkHUHvh0lHb1AJKkHiPaKZBUXUcRAHn1bxO2YvDKgYzI 6bltlQVtUN2fbm3zWek5icmUGUo7Da5WUw77wkRxE04Lsc6UHhgNtSuVsxWwWkQP kzTM7GyUowDtZL/i/Uwix0jy5hVXr8CMpWtopnzjBFKUAAWoVlVWnY+cn01oZeXg icU8Os0Xt2aFmxRjHzzKICo7QQfD/9DmHU8Sk2Y3h3NERzwh3HPtCiRtZrLnJwY= =Wq26 -----END PGP SIGNATURE----- --BIHIcAOlkarhJXAFL1bc4cuXBdbdhvbNV--