Received: from eggs.gnu.org ([2001:4830:134:3::10]:39146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbWMB-0003i7-Dt for qemu-devel@nongnu.org; Mon, 14 Sep 2015 12:11:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbWM8-0005sz-80 for qemu-devel@nongnu.org; Mon, 14 Sep 2015 12:11:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbWM8-0005sr-35 for qemu-devel@nongnu.org; Mon, 14 Sep 2015 12:11:48 -0400 From: Markus Armbruster References: <1442231543-23446-1-git-send-email-armbru@redhat.com> <20150914115736.GA2111@nanopsycho.orion> <55F6EDFC.2070503@redhat.com> Date: Mon, 14 Sep 2015 18:11:44 +0200 In-Reply-To: <55F6EDFC.2070503@redhat.com> (Eric Blake's message of "Mon, 14 Sep 2015 09:55:40 -0600") Message-ID: <87h9mxkmkf.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] rocker: Use g_new() & friends where that makes obvious sense List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: sfeldma@gmail.com, Jiri Pirko , qemu-devel@nongnu.org Eric Blake writes: > On 09/14/2015 05:57 AM, Jiri Pirko wrote: >> Mon, Sep 14, 2015 at 01:52:23PM CEST, armbru@redhat.com 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. >> >> ^ typo :) >> > > This typo is copy-pasted into ALL of your recent g_new() cleanups. Since > you did scattershot threads across multiple maintainers rather than one > big thread, it may be a bit harder to plug all the instances before they > get pulled through the various trees. Only three of them, actually: this one, linux-user and qemu-char. [...]