[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v2] spar: remove extra type variable
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [PATCH v2] spar: remove extra type variable |
Date: |
Wed, 10 Aug 2016 14:47:10 +1000 |
User-agent: |
Mutt/1.6.2 (2016-07-01) |
On Tue, Aug 09, 2016 at 01:15:05PM +0200, Cédric 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.
>
> Signed-off-by: Cédric Le Goater <address@hidden>
I already merged this as part of Thomas' series.
> ---
> hw/ppc/spapr.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> Index: qemu-dgibson-for-2.8.git/hw/ppc/spapr.c
> ===================================================================
> --- 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 = spapr_get_cpu_core_type(machine->cpu_model);
>
> + if (!object_class_by_name(type)) {
> + error_report("Unable to find sPAPR CPU Core definition");
> + exit(1);
> + }
> +
> spapr->cores = g_new0(Object *, spapr_max_cores);
> for (i = 0; i < spapr_max_cores; i++) {
> int core_id = i * smp_threads;
> @@ -1783,15 +1788,7 @@ static void ppc_spapr_init(MachineState
> qemu_register_reset(spapr_drc_reset, drc);
>
> if (i < spapr_cores) {
> - char *type = spapr_get_cpu_core_type(machine->cpu_model);
> - Object *core;
> -
> - if (!object_class_by_name(type)) {
> - error_report("Unable to find sPAPR CPU Core definition");
> - exit(1);
> - }
> -
> - core = object_new(type);
> + Object *core = object_new(type);
> object_property_set_int(core, smp_threads, "nr-threads",
> &error_fatal);
> object_property_set_int(core, core_id, CPU_CORE_PROP_CORE_ID,
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature