From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b899P-0005KQ-PM for qemu-devel@nongnu.org; Wed, 01 Jun 2016 12:37:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b899N-0007t3-Sp for qemu-devel@nongnu.org; Wed, 01 Jun 2016 12:37:46 -0400 From: Igor Mammedov Date: Wed, 1 Jun 2016 18:37:25 +0200 Message-Id: <1464799050-11002-4-git-send-email-imammedo@redhat.com> In-Reply-To: <1464799050-11002-1-git-send-email-imammedo@redhat.com> References: <1464799050-11002-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH RFC 3/8] target-i386: cpu: use cpu_generic_init() in cpu_x86_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, blauwirbel@gmail.com, mark.cave-ayland@ilande.co.uk, qemu-arm@nongnu.org now cpu_x86_init() does nothing more or less than duplicating cpu_generic_init() logic. So simplify it by using cpu_generic_init(). Signed-off-by: Igor Mammedov --- target-i386/cpu.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index c31afc7..238f69d 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2240,25 +2240,7 @@ out: X86CPU *cpu_x86_init(const char *cpu_model) { - Error *error = NULL; - X86CPU *cpu; - - cpu = cpu_x86_create(cpu_model, &error); - if (error) { - goto out; - } - - object_property_set_bool(OBJECT(cpu), true, "realized", &error); - -out: - if (error) { - error_report_err(error); - if (cpu != NULL) { - object_unref(OBJECT(cpu)); - cpu = NULL; - } - } - return cpu; + return X86_CPU(cpu_generic_init(TYPE_X86_CPU, cpu_model)); } static void x86_cpu_cpudef_class_init(ObjectClass *oc, void *data) -- 1.8.3.1