diff mbox

[5/5] cpu/hotplug: remove the left unused cpu hotplug notifier function

Message ID 1409735177-17232-6-git-send-email-guz.fnst@cn.fujitsu.com
State New
Headers show

Commit Message

Gu Zheng Sept. 3, 2014, 9:06 a.m. UTC
Remove the left unused cpu hotplug notifier function, and rename
AcpiCpuHotplug_init --> acpi_cpu_hotplug_init
AcpiCpuHotplug_ops --> acpi_cpu_hotplug_ops
to match the coding style.

Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
---
 hw/acpi/cpu_hotplug.c         |   17 +++--------------
 hw/acpi/ich9.c                |    2 +-
 hw/acpi/piix4.c               |    2 +-
 include/hw/acpi/cpu_hotplug.h |    3 +--
 4 files changed, 6 insertions(+), 18 deletions(-)

Comments

Igor Mammedov Sept. 10, 2014, 1:59 p.m. UTC | #1
On Wed,  3 Sep 2014 17:06:17 +0800
Gu Zheng <guz.fnst@cn.fujitsu.com> wrote:

> Remove the left unused cpu hotplug notifier function, and rename
> AcpiCpuHotplug_init --> acpi_cpu_hotplug_init
> AcpiCpuHotplug_ops --> acpi_cpu_hotplug_ops
> to match the coding style.
split renaming into separate patch please

> 
> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
> ---
>  hw/acpi/cpu_hotplug.c         |   17 +++--------------
>  hw/acpi/ich9.c                |    2 +-
>  hw/acpi/piix4.c               |    2 +-
>  include/hw/acpi/cpu_hotplug.h |    3 +--
>  4 files changed, 6 insertions(+), 18 deletions(-)
> 
> diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
> index 92c189b..494d22b 100644
> --- a/hw/acpi/cpu_hotplug.c
> +++ b/hw/acpi/cpu_hotplug.c
> @@ -26,7 +26,7 @@ static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data,
>      /* TODO: implement VCPU removal on guest signal that CPU can be removed */
>  }
>  
> -static const MemoryRegionOps AcpiCpuHotplug_ops = {
> +static const MemoryRegionOps acpi_cpu_hotplug_ops = {
>      .read = cpu_status_read,
>      .write = cpu_status_write,
>      .endianness = DEVICE_LITTLE_ENDIAN,
> @@ -53,18 +53,7 @@ void acpi_cpu_plug_cb(ACPIREGS *ar, qemu_irq irq,
>      cpu_resume(cpu);
>  }
>  
> -void AcpiCpuHotplug_add(ACPIGPE *gpe, AcpiCpuHotplug *g, CPUState *cpu)
> -{
> -    CPUClass *k = CPU_GET_CLASS(cpu);
> -    int64_t cpu_id;
> -
> -    *gpe->sts = *gpe->sts | ACPI_CPU_HOTPLUG_STATUS;
> -    cpu_id = k->get_arch_id(CPU(cpu));
> -    g_assert((cpu_id / 8) < ACPI_GPE_PROC_LEN);
> -    g->sts[cpu_id / 8] |= (1 << (cpu_id % 8));
> -}

instead of copying contents of this function in 1/5 and deleting it here
could you in 1/5 make a wrapper around this one and drop this function
declaration later in 3/5 with it's last use.

> -
> -void AcpiCpuHotplug_init(MemoryRegion *parent, Object *owner,
> +void acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,
>                           AcpiCpuHotplug *gpe_cpu, uint16_t base)
>  {
>      CPUState *cpu;
> @@ -76,7 +65,7 @@ void AcpiCpuHotplug_init(MemoryRegion *parent, Object *owner,
>          g_assert((id / 8) < ACPI_GPE_PROC_LEN);
>          gpe_cpu->sts[id / 8] |= (1 << (id % 8));
>      }
> -    memory_region_init_io(&gpe_cpu->io, owner, &AcpiCpuHotplug_ops,
> +    memory_region_init_io(&gpe_cpu->io, owner, &acpi_cpu_hotplug_ops,
>                            gpe_cpu, "acpi-cpu-hotplug", ACPI_GPE_PROC_LEN);
>      memory_region_add_subregion(parent, base, &gpe_cpu->io);
>  }
> diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
> index 89f97d7..adf5919 100644
> --- a/hw/acpi/ich9.c
> +++ b/hw/acpi/ich9.c
> @@ -235,7 +235,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
>      pm->powerdown_notifier.notify = pm_powerdown_req;
>      qemu_register_powerdown_notifier(&pm->powerdown_notifier);
>  
> -    AcpiCpuHotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci),
> +    acpi_cpu_hotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci),
>                          &pm->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE);
>  
>      if (pm->acpi_memory_hotplug.is_enabled) {
> diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
> index 6209385..6e91a92 100644
> --- a/hw/acpi/piix4.c
> +++ b/hw/acpi/piix4.c
> @@ -555,7 +555,7 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
>      acpi_pcihp_init(&s->acpi_pci_hotplug, bus, parent,
>                      s->use_acpi_pci_hotplug);
>  
> -    AcpiCpuHotplug_init(parent, OBJECT(s), &s->gpe_cpu,
> +    acpi_cpu_hotplug_init(parent, OBJECT(s), &s->gpe_cpu,
>                          PIIX4_CPU_HOTPLUG_IO_BASE);
>  
>      if (s->acpi_memory_hotplug.is_enabled) {
> diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h
> index d025731..be2f516 100644
> --- a/include/hw/acpi/cpu_hotplug.h
> +++ b/include/hw/acpi/cpu_hotplug.h
> @@ -23,8 +23,7 @@ typedef struct AcpiCpuHotplug {
>  void acpi_cpu_plug_cb(ACPIREGS *ar, qemu_irq irq,
>                            AcpiCpuHotplug *g, DeviceState *dev);
>  
> -void AcpiCpuHotplug_add(ACPIGPE *gpe, AcpiCpuHotplug *g, CPUState *cpu);
>  
> -void AcpiCpuHotplug_init(MemoryRegion *parent, Object *owner,
> +void acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,
>                           AcpiCpuHotplug *gpe_cpu, uint16_t base);
>  #endif
diff mbox

Patch

diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
index 92c189b..494d22b 100644
--- a/hw/acpi/cpu_hotplug.c
+++ b/hw/acpi/cpu_hotplug.c
@@ -26,7 +26,7 @@  static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data,
     /* TODO: implement VCPU removal on guest signal that CPU can be removed */
 }
 
-static const MemoryRegionOps AcpiCpuHotplug_ops = {
+static const MemoryRegionOps acpi_cpu_hotplug_ops = {
     .read = cpu_status_read,
     .write = cpu_status_write,
     .endianness = DEVICE_LITTLE_ENDIAN,
@@ -53,18 +53,7 @@  void acpi_cpu_plug_cb(ACPIREGS *ar, qemu_irq irq,
     cpu_resume(cpu);
 }
 
-void AcpiCpuHotplug_add(ACPIGPE *gpe, AcpiCpuHotplug *g, CPUState *cpu)
-{
-    CPUClass *k = CPU_GET_CLASS(cpu);
-    int64_t cpu_id;
-
-    *gpe->sts = *gpe->sts | ACPI_CPU_HOTPLUG_STATUS;
-    cpu_id = k->get_arch_id(CPU(cpu));
-    g_assert((cpu_id / 8) < ACPI_GPE_PROC_LEN);
-    g->sts[cpu_id / 8] |= (1 << (cpu_id % 8));
-}
-
-void AcpiCpuHotplug_init(MemoryRegion *parent, Object *owner,
+void acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,
                          AcpiCpuHotplug *gpe_cpu, uint16_t base)
 {
     CPUState *cpu;
@@ -76,7 +65,7 @@  void AcpiCpuHotplug_init(MemoryRegion *parent, Object *owner,
         g_assert((id / 8) < ACPI_GPE_PROC_LEN);
         gpe_cpu->sts[id / 8] |= (1 << (id % 8));
     }
-    memory_region_init_io(&gpe_cpu->io, owner, &AcpiCpuHotplug_ops,
+    memory_region_init_io(&gpe_cpu->io, owner, &acpi_cpu_hotplug_ops,
                           gpe_cpu, "acpi-cpu-hotplug", ACPI_GPE_PROC_LEN);
     memory_region_add_subregion(parent, base, &gpe_cpu->io);
 }
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 89f97d7..adf5919 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -235,7 +235,7 @@  void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
     pm->powerdown_notifier.notify = pm_powerdown_req;
     qemu_register_powerdown_notifier(&pm->powerdown_notifier);
 
-    AcpiCpuHotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci),
+    acpi_cpu_hotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci),
                         &pm->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE);
 
     if (pm->acpi_memory_hotplug.is_enabled) {
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 6209385..6e91a92 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -555,7 +555,7 @@  static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
     acpi_pcihp_init(&s->acpi_pci_hotplug, bus, parent,
                     s->use_acpi_pci_hotplug);
 
-    AcpiCpuHotplug_init(parent, OBJECT(s), &s->gpe_cpu,
+    acpi_cpu_hotplug_init(parent, OBJECT(s), &s->gpe_cpu,
                         PIIX4_CPU_HOTPLUG_IO_BASE);
 
     if (s->acpi_memory_hotplug.is_enabled) {
diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h
index d025731..be2f516 100644
--- a/include/hw/acpi/cpu_hotplug.h
+++ b/include/hw/acpi/cpu_hotplug.h
@@ -23,8 +23,7 @@  typedef struct AcpiCpuHotplug {
 void acpi_cpu_plug_cb(ACPIREGS *ar, qemu_irq irq,
                           AcpiCpuHotplug *g, DeviceState *dev);
 
-void AcpiCpuHotplug_add(ACPIGPE *gpe, AcpiCpuHotplug *g, CPUState *cpu);
 
-void AcpiCpuHotplug_init(MemoryRegion *parent, Object *owner,
+void acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,
                          AcpiCpuHotplug *gpe_cpu, uint16_t base);
 #endif