[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC qom-cpu v4 02/10] apic: remove redundant variable 'api
From: |
Chen Fan |
Subject: |
[Qemu-devel] [RFC qom-cpu v4 02/10] apic: remove redundant variable 'apic_no' from apic_init_common() |
Date: |
Wed, 9 Oct 2013 17:43:10 +0800 |
In struct APICCommonState, there is an id field yet, which was set earlier,
qdev_prop_set_uint8(env->apic_state, "id", env->cpuid_apic_id);
so we use the id field instead of the variable 'apic_no' to represent the
unique apic
index.
Signed-off-by: Chen Fan <address@hidden>
---
hw/intc/apic_common.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index a0beb10..82fbb7f 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -289,13 +289,9 @@ static int apic_init_common(ICCDevice *dev)
APICCommonState *s = APIC_COMMON(dev);
APICCommonClass *info;
static DeviceState *vapic;
- static int apic_no;
static bool mmio_registered;
- if (apic_no >= MAX_APICS) {
- return -1;
- }
- s->idx = apic_no++;
+ s->idx = s->id;
info = APIC_COMMON_GET_CLASS(s);
info->init(s);
--
1.8.1.4
- [Qemu-devel] [RFC qom-cpu v4 00/10] i386: add cpu hot remove support, Chen Fan, 2013/10/09
- [Qemu-devel] [RFC qom-cpu v4 02/10] apic: remove redundant variable 'apic_no' from apic_init_common(),
Chen Fan <=
- [Qemu-devel] [RFC qom-cpu v4 04/10] x86: add x86_cpu_unrealizefn() for cpu apic remove, Chen Fan, 2013/10/09
- [Qemu-devel] [RFC qom-cpu v4 01/10] x86: move apic_state field from CPUX86State to X86CPU, Chen Fan, 2013/10/09
- [Qemu-devel] [RFC qom-cpu v4 03/10] apic: remove local_apics array and using CPU_FOREACH instead, Chen Fan, 2013/10/09
- [Qemu-devel] [RFC qom-cpu v4 05/10] qmp: add 'cpu-del' command support, Chen Fan, 2013/10/09
- [Qemu-devel] [RFC qom-cpu v4 07/10] qom cpu: add UNPLUG cpu notifier support, Chen Fan, 2013/10/09
- [Qemu-devel] [RFC qom-cpu v4 08/10] i386: implement pc interface pc_hot_del_cpu(), Chen Fan, 2013/10/09
- [Qemu-devel] [RFC qom-cpu v4 09/10] piix4: implement function cpu_status_write() for vcpu ejection, Chen Fan, 2013/10/09
- [Qemu-devel] [RFC qom-cpu v4 10/10] cpus: reclaim allocated vCPU objects, Chen Fan, 2013/10/09
- [Qemu-devel] [RFC qom-cpu v4 06/10] qom cpu: rename variable 'cpu_added_notifier' to 'cpu_hotplug_notifier', Chen Fan, 2013/10/09