qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Gu Zheng <guz.fnst@cn.fujitsu.com>
Cc: chen.fan.fnst@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com,
	qemu-devel@nongnu.org, afaerber@suse.de, tangchen@cn.fujitsu.com
Subject: Re: [Qemu-devel] [PATCH 5/5] cpu/hotplug: remove the left unused cpu hotplug notifier function
Date: Wed, 10 Sep 2014 15:59:18 +0200	[thread overview]
Message-ID: <20140910155918.27d24b99@nial.usersys.redhat.com> (raw)
In-Reply-To: <1409735177-17232-6-git-send-email-guz.fnst@cn.fujitsu.com>

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

  reply	other threads:[~2014-09-10 13:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03  9:06 [Qemu-devel] [PATCH 0/5] cpu/acpi: convert cpu hot plug to hotplug_handler API Gu Zheng
2014-09-03  9:06 ` [Qemu-devel] [PATCH 1/5] acpi/cpu: add cpu hotplug callback function to match " Gu Zheng
2014-09-10 13:28   ` Igor Mammedov
2014-09-11  3:04     ` Gu Zheng
2014-09-11 10:12       ` Igor Mammedov
2014-09-12  1:39         ` Gu Zheng
2014-09-03  9:06 ` [Qemu-devel] [PATCH 2/5] acpi:ich9: convert cpu hotplug handle to " Gu Zheng
2014-09-03  9:06 ` [Qemu-devel] [PATCH 3/5] acpi:piix4: " Gu Zheng
2014-09-03  9:06 ` [Qemu-devel] [PATCH 4/5] pc: add cpu hotplug handler to PC_MACHINE Gu Zheng
2014-09-10 13:55   ` Igor Mammedov
2014-09-12  3:02     ` Gu Zheng
2014-09-12 14:28       ` Igor Mammedov
2014-09-15  3:57         ` Gu Zheng
2014-09-15  8:11           ` Igor Mammedov
2014-09-10 14:02   ` Igor Mammedov
2014-09-03  9:06 ` [Qemu-devel] [PATCH 5/5] cpu/hotplug: remove the left unused cpu hotplug notifier function Gu Zheng
2014-09-10 13:59   ` Igor Mammedov [this message]
2014-09-10 14:12 ` [Qemu-devel] [PATCH 0/5] cpu/acpi: convert cpu hot plug to hotplug_handler API Igor Mammedov
2014-09-11  2:53   ` Gu Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140910155918.27d24b99@nial.usersys.redhat.com \
    --to=imammedo@redhat.com \
    --cc=afaerber@suse.de \
    --cc=chen.fan.fnst@cn.fujitsu.com \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tangchen@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).