From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRiQl-0003Sx-PZ for qemu-devel@nongnu.org; Wed, 10 Sep 2014 09:59:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRiQg-00064G-TJ for qemu-devel@nongnu.org; Wed, 10 Sep 2014 09:59:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRiQg-00062V-Kb for qemu-devel@nongnu.org; Wed, 10 Sep 2014 09:59:26 -0400 Date: Wed, 10 Sep 2014 15:59:18 +0200 From: Igor Mammedov Message-ID: <20140910155918.27d24b99@nial.usersys.redhat.com> In-Reply-To: <1409735177-17232-6-git-send-email-guz.fnst@cn.fujitsu.com> References: <1409735177-17232-1-git-send-email-guz.fnst@cn.fujitsu.com> <1409735177-17232-6-git-send-email-guz.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/5] cpu/hotplug: remove the left unused cpu hotplug notifier function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gu Zheng Cc: chen.fan.fnst@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com, qemu-devel@nongnu.org, afaerber@suse.de, tangchen@cn.fujitsu.com On Wed, 3 Sep 2014 17:06:17 +0800 Gu Zheng 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 > --- > 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