diff mbox

[3/8] spapr: drop duplicate variable in spapr_core_release()

Message ID 146723344568.9665.8138511936964587804.stgit@bahia.lan (mailing list archive)
State New, archived
Headers show

Commit Message

Greg Kurz June 29, 2016, 8:50 p.m. UTC
Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/ppc/spapr_cpu_core.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Bharata B Rao June 30, 2016, 4:29 a.m. UTC | #1
On Wed, Jun 29, 2016 at 10:50:45PM +0200, Greg Kurz wrote:
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
>  hw/ppc/spapr_cpu_core.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
> index 2615058da745..a15dc010626d 100644
> --- a/hw/ppc/spapr_cpu_core.c
> +++ b/hw/ppc/spapr_cpu_core.c
> @@ -101,9 +101,8 @@ static void spapr_core_release(DeviceState *dev, void *opaque)
>      sPAPRCPUCore *sc = SPAPR_CPU_CORE(OBJECT(dev));
>      const char *typename = object_class_get_name(sc->cpu_class);
>      size_t size = object_type_get_instance_size(typename);
>      sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
> -    sPAPRCPUCore *core = SPAPR_CPU_CORE(OBJECT(dev));
>      CPUCore *cc = CPU_CORE(dev);
>      int smt = kvmppc_smt_threads();
>      int i;
> 
> @@ -119,9 +118,9 @@ static void spapr_core_release(DeviceState *dev, void *opaque)
>      }
> 
>      spapr->cores[cc->core_id / smt] = NULL;
> 
> -    g_free(core->threads);
> +    g_free(sc->threads);
>      object_unparent(OBJECT(dev));
>  }
> 
>  void spapr_core_unplug(HotplugHandler *hotplug_dev, DeviceState *dev,

Reviewed-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
diff mbox

Patch

diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 2615058da745..a15dc010626d 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -101,9 +101,8 @@  static void spapr_core_release(DeviceState *dev, void *opaque)
     sPAPRCPUCore *sc = SPAPR_CPU_CORE(OBJECT(dev));
     const char *typename = object_class_get_name(sc->cpu_class);
     size_t size = object_type_get_instance_size(typename);
     sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
-    sPAPRCPUCore *core = SPAPR_CPU_CORE(OBJECT(dev));
     CPUCore *cc = CPU_CORE(dev);
     int smt = kvmppc_smt_threads();
     int i;
 
@@ -119,9 +118,9 @@  static void spapr_core_release(DeviceState *dev, void *opaque)
     }
 
     spapr->cores[cc->core_id / smt] = NULL;
 
-    g_free(core->threads);
+    g_free(sc->threads);
     object_unparent(OBJECT(dev));
 }
 
 void spapr_core_unplug(HotplugHandler *hotplug_dev, DeviceState *dev,