From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuiLJ-0007y0-Gw for qemu-devel@nongnu.org; Fri, 06 Nov 2015 09:50:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuiLI-0004Nv-M3 for qemu-devel@nongnu.org; Fri, 06 Nov 2015 09:50:17 -0500 Received: from mail-vk0-x233.google.com ([2607:f8b0:400c:c05::233]:36080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuiLI-0004Nj-I6 for qemu-devel@nongnu.org; Fri, 06 Nov 2015 09:50:16 -0500 Received: by vkex70 with SMTP id x70so15400469vke.3 for ; Fri, 06 Nov 2015 06:50:16 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20151106142955.GN13308@toto> References: <1446747358-18214-1-git-send-email-peter.maydell@linaro.org> <1446747358-18214-12-git-send-email-peter.maydell@linaro.org> <20151106142955.GN13308@toto> From: Peter Maydell Date: Fri, 6 Nov 2015 14:49:56 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 11/16] memory: Add address_space_init_shareable() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: Patch Tracking , QEMU Developers , qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?B?QWxleCBCZW5uw6ll?= , =?UTF-8?Q?Andreas_F=C3=A4rber?= On 6 November 2015 at 14:29, Edgar E. Iglesias wrote: > On Thu, Nov 05, 2015 at 06:15:53PM +0000, Peter Maydell wrote: >> +AddressSpace *address_space_init_shareable(MemoryRegion *root, const char *name) >> +{ >> + AddressSpace *as; >> + >> + QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) { >> + if (root == as->root) { >> + as->ref_count++; >> + return as; >> + } >> + } >> + >> + as = g_malloc0(sizeof *as); >> + address_space_init(as, root, name); > > Nit-pick but IIUC, address_space_init does not need AS to be zeroed > so this could be changed to a g_malloc(). I tend to prefer to be conservative about these things, so I use zero-allocation unless I'm really sure it's unnecessary. > either-way: > > Reviewed-by: Edgar E. Iglesias thanks -- PMM