From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUuIt-0006LV-K8 for qemu-devel@nongnu.org; Thu, 06 Dec 2018 09:07:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUuIs-0001CQ-TA for qemu-devel@nongnu.org; Thu, 06 Dec 2018 09:06:59 -0500 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:37095) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gUuIs-0001Ba-Lm for qemu-devel@nongnu.org; Thu, 06 Dec 2018 09:06:58 -0500 Received: by mail-ot1-x344.google.com with SMTP id 40so499381oth.4 for ; Thu, 06 Dec 2018 06:06:58 -0800 (PST) MIME-Version: 1.0 References: <20181205205827.19387-1-ehabkost@redhat.com> <20181205205827.19387-2-ehabkost@redhat.com> In-Reply-To: <20181205205827.19387-2-ehabkost@redhat.com> From: Peter Maydell Date: Thu, 6 Dec 2018 14:06:46 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PATCH for-4.0 1/5] virt: Eliminate separate instance_init functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: QEMU Developers , Paolo Bonzini , =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= , Marcel Apfelbaum , "Michael S. Tsirkin" , David Gibson , qemu-arm , qemu-ppc , Richard Henderson On Wed, 5 Dec 2018 at 20:58, Eduardo Habkost wrote: > > All instance_init functions for all virt machine-types run > exactly the same code, so we don't need separate functions. We > only need to set instance_init for TYPE_VIRT_MACHINE. > > Signed-off-by: Eduardo Habkost > --- > hw/arm/virt.c | 87 +++++++++++++-------------------------------------- > 1 file changed, 21 insertions(+), 66 deletions(-) > > +static const TypeInfo virt_machine_info = { > + .name = TYPE_VIRT_MACHINE, > + .parent = TYPE_MACHINE, > + .abstract = true, > + .instance_size = sizeof(VirtMachineState), > + .class_size = sizeof(VirtMachineClass), > + .class_init = virt_machine_class_init, > + .instance_init = virt_instance_init, Indentation looks like it's not quite right here. > + .interfaces = (InterfaceInfo[]) { > + { TYPE_HOTPLUG_HANDLER }, > + { } > + }, > +}; Otherwise Reviewed-by: Peter Maydell thanks -- PMM