Message ID | 1377302436-25193-4-git-send-email-afaerber@suse.de |
---|---|
State | New |
Headers | show |
> To be passed to qbus_create_inplace(). > > Simplify DEVICE() cast to avoid parent field access. s->dev will always point to pci_dev, so this change is safe. Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> > > Signed-off-by: Andreas Färber <afaerber@suse.de> > --- > hw/char/ipack.c | 3 ++- > hw/char/ipack.h | 3 ++- > hw/char/tpci200.c | 2 +- > 3 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/hw/char/ipack.c b/hw/char/ipack.c > index f890471..5fb7073 100644 > --- a/hw/char/ipack.c > +++ b/hw/char/ipack.c > @@ -24,7 +24,8 @@ IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot) > return NULL; > } > > -void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent, > +void ipack_bus_new_inplace(IPackBus *bus, size_t bus_size, > + DeviceState *parent, > const char *name, uint8_t n_slots, > qemu_irq_handler handler) > { > diff --git a/hw/char/ipack.h b/hw/char/ipack.h > index f2b7a12..f8dc0f2 100644 > --- a/hw/char/ipack.h > +++ b/hw/char/ipack.h > @@ -72,7 +72,8 @@ extern const VMStateDescription vmstate_ipack_device; > VMSTATE_STRUCT(_field, _state, 1, vmstate_ipack_device, IPackDevice) > > IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot); > -void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent, > +void ipack_bus_new_inplace(IPackBus *bus, size_t bus_size, > + DeviceState *parent, > const char *name, uint8_t n_slots, > qemu_irq_handler handler); > > diff --git a/hw/char/tpci200.c b/hw/char/tpci200.c > index d9e17b2..e04ff26 100644 > --- a/hw/char/tpci200.c > +++ b/hw/char/tpci200.c > @@ -607,7 +607,7 @@ static int tpci200_initfn(PCIDevice *pci_dev) > pci_register_bar(&s->dev, 4, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->las2); > pci_register_bar(&s->dev, 5, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->las3); > > - ipack_bus_new_inplace(&s->bus, DEVICE(&s->dev), NULL, > + ipack_bus_new_inplace(&s->bus, sizeof(s->bus), DEVICE(pci_dev), NULL, > N_MODULES, tpci200_set_irq); > > return 0; >
diff --git a/hw/char/ipack.c b/hw/char/ipack.c index f890471..5fb7073 100644 --- a/hw/char/ipack.c +++ b/hw/char/ipack.c @@ -24,7 +24,8 @@ IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot) return NULL; } -void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent, +void ipack_bus_new_inplace(IPackBus *bus, size_t bus_size, + DeviceState *parent, const char *name, uint8_t n_slots, qemu_irq_handler handler) { diff --git a/hw/char/ipack.h b/hw/char/ipack.h index f2b7a12..f8dc0f2 100644 --- a/hw/char/ipack.h +++ b/hw/char/ipack.h @@ -72,7 +72,8 @@ extern const VMStateDescription vmstate_ipack_device; VMSTATE_STRUCT(_field, _state, 1, vmstate_ipack_device, IPackDevice) IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot); -void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent, +void ipack_bus_new_inplace(IPackBus *bus, size_t bus_size, + DeviceState *parent, const char *name, uint8_t n_slots, qemu_irq_handler handler); diff --git a/hw/char/tpci200.c b/hw/char/tpci200.c index d9e17b2..e04ff26 100644 --- a/hw/char/tpci200.c +++ b/hw/char/tpci200.c @@ -607,7 +607,7 @@ static int tpci200_initfn(PCIDevice *pci_dev) pci_register_bar(&s->dev, 4, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->las2); pci_register_bar(&s->dev, 5, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->las3); - ipack_bus_new_inplace(&s->bus, DEVICE(&s->dev), NULL, + ipack_bus_new_inplace(&s->bus, sizeof(s->bus), DEVICE(pci_dev), NULL, N_MODULES, tpci200_set_irq); return 0;
To be passed to qbus_create_inplace(). Simplify DEVICE() cast to avoid parent field access. Signed-off-by: Andreas Färber <afaerber@suse.de> --- hw/char/ipack.c | 3 ++- hw/char/ipack.h | 3 ++- hw/char/tpci200.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-)