From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbWKA-00037t-K2 for qemu-devel@nongnu.org; Mon, 14 Sep 2015 12:09:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbWK6-0003ZK-Mv for qemu-devel@nongnu.org; Mon, 14 Sep 2015 12:09:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbWK6-0003YO-IW for qemu-devel@nongnu.org; Mon, 14 Sep 2015 12:09:42 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 2CF1C91DD6 for ; Mon, 14 Sep 2015 16:09:42 +0000 (UTC) References: <1442231643-23630-1-git-send-email-armbru@redhat.com> <55F6EE19.30703@redhat.com> From: Eric Blake Message-ID: <55F6F145.9060507@redhat.com> Date: Mon, 14 Sep 2015 10:09:41 -0600 MIME-Version: 1.0 In-Reply-To: <55F6EE19.30703@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PS7DFpt5OP5ivBWcRvskUEDw2JDk5wqlD" Subject: Re: [Qemu-devel] [PATCH] qemu-char: Use g_new() & friends where that makes obvious sense List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PS7DFpt5OP5ivBWcRvskUEDw2JDk5wqlD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/14/2015 09:56 AM, Eric Blake wrote: > On 09/14/2015 05:54 AM, Markus Armbruster wrote: >> g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, >> for two reasons. One, it catches multiplication overflowing size_t. >> Two, it returns T * rather than void *, which lets the compiler catch >> more type errors. >> >> This commit only touches allocations with size arguments of the form >> sizeof(T). Same Coccinelle semantic patchas in commit b45c03f. s/patchas/patch as/ >> >> Signed-off-by: Markus Armbruster >> --- >> backends/testdev.c | 4 ++-- >> qemu-char.c | 22 +++++++++++----------- >> 2 files changed, 13 insertions(+), 13 deletions(-) >=20 > Reviewed-by: Eric Blake >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --PS7DFpt5OP5ivBWcRvskUEDw2JDk5wqlD 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/ iQEcBAEBCAAGBQJV9vFFAAoJEKeha0olJ0NqS2QIAJUdVdu61IjRoF4eoBvjbWm5 LvMFgjhrTnnaqxyzBM2EIp09Gbkhp/xYTkf32QQ3O7ZRGn0UFfuDACGVh9BnGUJC mjyGLl8wOjJzP30TclPAg4PBDXT1SL6gSFDE3IooV85ui74QRAoieAkd/0gC306H owl+BYJ9NDtZqP3RAXixsV5CxrlGGbMnYlvFiRRwehCKvHk27tGNZIEAAf/avNCs Cnbij1eeawuAxOvkYPbX9BrhNw4KmKBugeGP8/bCVLlhrGFXFX3yleNyV6GO+VCM HgVN73osegONojYDOODK/8kfvCLmICxteaEL4kpzwcyzs0dTUjff2sKU0IzkHnI= =9t/0 -----END PGP SIGNATURE----- --PS7DFpt5OP5ivBWcRvskUEDw2JDk5wqlD--