diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2019-12-13 12:11:45 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-12-17 19:33:51 +0100 |
commit | 14a1bb48ea48d541ea6f373c12fb7e88d2c89d8f (patch) | |
tree | 5aad22356b81519c895610538c10bf8ffd96abbf /hw/i386/x86.c | |
parent | 64c033badda77d81d7c949fc6e3ed6c72dd5c92e (diff) | |
download | qemu-14a1bb48ea48d541ea6f373c12fb7e88d2c89d8f.zip |
hw/i386: Simplify ioapic_init_gsi()
All callers of ioapic_init_gsi() provide a parent. We want new
uses to follow the same good practice and provide the parent
name, so do not make this optional: assert the parent name is
provided, and simplify the code.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/i386/x86.c')
-rw-r--r-- | hw/i386/x86.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/i386/x86.c b/hw/i386/x86.c index d18a3ef03d..d8bb5c2a96 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -307,15 +307,14 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name) SysBusDevice *d; unsigned int i; + assert(parent_name); if (kvm_ioapic_in_kernel()) { dev = qdev_create(NULL, TYPE_KVM_IOAPIC); } else { dev = qdev_create(NULL, TYPE_IOAPIC); } - if (parent_name) { - object_property_add_child(object_resolve_path(parent_name, NULL), - "ioapic", OBJECT(dev), NULL); - } + object_property_add_child(object_resolve_path(parent_name, NULL), + "ioapic", OBJECT(dev), NULL); qdev_init_nofail(dev); d = SYS_BUS_DEVICE(dev); sysbus_mmio_map(d, 0, IO_APIC_DEFAULT_ADDRESS); |