From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkRL0-0003Y8-Q6 for qemu-devel@nongnu.org; Fri, 09 Oct 2015 02:39:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkRKv-0005E7-RH for qemu-devel@nongnu.org; Fri, 09 Oct 2015 02:39:30 -0400 References: <1444332916-16476-1-git-send-email-thuth@redhat.com> <1444332916-16476-2-git-send-email-thuth@redhat.com> <5616D94C.4040109@redhat.com> From: Thomas Huth Message-ID: <5617611A.90205@redhat.com> Date: Fri, 9 Oct 2015 08:39:22 +0200 MIME-Version: 1.0 In-Reply-To: <5616D94C.4040109@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KD6HewJjqNSm4mT5iFOogCrTM52Kl0AAN" 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: Eric Blake , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KD6HewJjqNSm4mT5iFOogCrTM52Kl0AAN Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/10/15 22:59, Eric Blake wrote: > On 10/08/2015 01:35 PM, Thomas Huth wrote: >> g_malloc0 already clears the memory, so no need for >> the additional memset here. >> >> Signed-off-by: Thomas Huth >> --- >> hw/dma/pxa2xx_dma.c | 1 - >> 1 file changed, 1 deletion(-) >> >> 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); >=20 > 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. Ok, I doubt that we really get overflows here, but g_new0 is certainly nicer here, so I'll change my patch accordingly. Thomas --KD6HewJjqNSm4mT5iFOogCrTM52Kl0AAN 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.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWF2EaAAoJEC7Z13T+cC21WtYQAKGNF4bidscjcmmPfjRrKj1W FNvsr7gNx/Xw/Mqt+chSdGsJV/hRpteyLxqycbRBkp3vUjthcfIHhbgL0fg15G5X OgVLIrCWZDWe0aY1h/vqYMXX2HxiAh0wRqazy2ViVaUS8XEd4UvzPnzm5sknxQj4 bVjwHGqEh7gNAb2tK/2lZ2AABdVDdqCuIMoo3kTEPaz0nNOHZe1XxagWUa883Pzk dwbp/3xJP3DAKqlnZH2s3OrjjPEkkP+lcscuAjbuxx05yIQdSZqhc7tWh2Lh5N5q T72gFvm7RIofKLPUWqkYbEBOiW3gO99EpKxwOorvzmg2HtMVx2ydtNcOpY0u7eYY OOYgBZhdSv3jPExJZjcbKE1v/tGa+wwtJu+/vtYzjMTx6nmpEcktkDE+yegpo7zB a5DL8y0wQcmZELNhK++2zQXLettxoQerTnFh7jM0HssjF36UNyhR5IlgUZDC8sVA zIjHz0Tfg1YyVyRVECTQyS5JOk5IxVyk7g3EVLMXAfFn6US8otQ9PQC8JL3M90Ed 32oc+m8pkHZcKL6cB6ctsBZZyV+RI0SwijYUpMaCk/6/3li+lPtu04pekY47uerT KW0is1gYKGiKR105JOK5SSr54pg+270JDAdrJ3LlDy/ET9q3+W8XcVLnndnwX7p6 9jAQZCJLAmMnwRp9gYu/ =cwIt -----END PGP SIGNATURE----- --KD6HewJjqNSm4mT5iFOogCrTM52Kl0AAN--