Received: from eggs.gnu.org ([2001:4830:134:3::10]:44466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX5HJ-00078n-0W for qemu-devel@nongnu.org; Tue, 09 Aug 2016 07:33:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX5HE-0006MG-RJ for qemu-devel@nongnu.org; Tue, 09 Aug 2016 07:32:59 -0400 References: <1470741305-20799-1-git-send-email-clg@kaod.org> From: Thomas Huth Message-ID: <5df64de7-8ac3-bda0-f33b-722ae674646e@redhat.com> Date: Tue, 9 Aug 2016 13:32:52 +0200 MIME-Version: 1.0 In-Reply-To: <1470741305-20799-1-git-send-email-clg@kaod.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] spar: remove extra type variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , qemu-ppc@nongnu.org Cc: David Gibson , Bharata B Rao , qemu-devel@nongnu.org On 09.08.2016 13:15, C=C3=A9dric Le Goater wrote: > The sPAPR CPU core typename is already available in the upper > block. Let's use it and move the check upward also. >=20 > Signed-off-by: C=C3=A9dric Le Goater > --- > hw/ppc/spapr.c | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) >=20 > Index: qemu-dgibson-for-2.8.git/hw/ppc/spapr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- qemu-dgibson-for-2.8.git.orig/hw/ppc/spapr.c > +++ qemu-dgibson-for-2.8.git/hw/ppc/spapr.c > @@ -1772,6 +1772,11 @@ static void ppc_spapr_init(MachineState > if (mc->query_hotpluggable_cpus) { > char *type =3D spapr_get_cpu_core_type(machine->cpu_model); > =20 > + if (!object_class_by_name(type)) { > + error_report("Unable to find sPAPR CPU Core definition"); > + exit(1); > + } > + > spapr->cores =3D g_new0(Object *, spapr_max_cores); > for (i =3D 0; i < spapr_max_cores; i++) { > int core_id =3D i * smp_threads; > @@ -1783,15 +1788,7 @@ static void ppc_spapr_init(MachineState > qemu_register_reset(spapr_drc_reset, drc); > =20 > if (i < spapr_cores) { > - char *type =3D spapr_get_cpu_core_type(machine->cpu_mo= del); > - Object *core; > - > - if (!object_class_by_name(type)) { > - error_report("Unable to find sPAPR CPU Core defini= tion"); > - exit(1); > - } > - > - core =3D object_new(type); > + Object *core =3D object_new(type); > object_property_set_int(core, smp_threads, "nr-threads= ", > &error_fatal); > object_property_set_int(core, core_id, CPU_CORE_PROP_C= ORE_ID, >=20 Reviewed-by: Thomas Huth