diff mbox series

[v2,17/18] hw/isa: Un-inline isa_bus_from_device()

Message ID 20230215161641.32663-18-philmd@linaro.org
State New
Headers show
Series hw/ide: Untangle ISA/PCI abuses of ide_init_ioport() | expand

Commit Message

Philippe Mathieu-Daudé Feb. 15, 2023, 4:16 p.m. UTC
No point in inlining isa_bus_from_device() which is only
used at device realization time.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/isa/isa-bus.c     | 5 +++++
 include/hw/isa/isa.h | 6 +-----
 2 files changed, 6 insertions(+), 5 deletions(-)

Comments

Bernhard Beschow Feb. 16, 2023, 3:28 p.m. UTC | #1
Am 15. Februar 2023 16:16:40 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>No point in inlining isa_bus_from_device() which is only
>used at device realization time.
>
>Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>---
> hw/isa/isa-bus.c     | 5 +++++
> include/hw/isa/isa.h | 6 +-----
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
>diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
>index 719f2e96f2..f44817b88b 100644
>--- a/hw/isa/isa-bus.c
>+++ b/hw/isa/isa-bus.c
>@@ -167,6 +167,11 @@ bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp)
>     return qdev_realize_and_unref(&dev->parent_obj, &bus->parent_obj, errp);
> }
> 
>+ISABus *isa_bus_from_device(ISADevice *dev)
>+{
>+    return ISA_BUS(qdev_get_parent_bus(DEVICE(dev)));
>+}
>+
> ISADevice *isa_vga_init(ISABus *bus)
> {
>     vga_interface_created = true;
>diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
>index 1084d68ead..c9954a7d99 100644
>--- a/include/hw/isa/isa.h
>+++ b/include/hw/isa/isa.h
>@@ -96,6 +96,7 @@ ISADevice *isa_vga_init(ISABus *bus);
> 
> /*  isa_get_irq() is deprecated, please use isa_bus_get_irq() instead. */
> qemu_irq isa_get_irq(ISADevice *dev, unsigned irqnum);
>+ISABus *isa_bus_from_device(ISADevice *dev);
> 
> /**
>  * isa_register_ioport: Install an I/O port region on the ISA bus.
>@@ -133,9 +134,4 @@ int isa_register_portio_list(ISADevice *dev,
>                              const MemoryRegionPortio *portio,
>                              void *opaque, const char *name);
> 
>-static inline ISABus *isa_bus_from_device(ISADevice *d)
>-{
>-    return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
>-}
>-
> #endif

Reviewed-by: Bernhard Beschow <shentey@gmail.com>
diff mbox series

Patch

diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 719f2e96f2..f44817b88b 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -167,6 +167,11 @@  bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp)
     return qdev_realize_and_unref(&dev->parent_obj, &bus->parent_obj, errp);
 }
 
+ISABus *isa_bus_from_device(ISADevice *dev)
+{
+    return ISA_BUS(qdev_get_parent_bus(DEVICE(dev)));
+}
+
 ISADevice *isa_vga_init(ISABus *bus)
 {
     vga_interface_created = true;
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 1084d68ead..c9954a7d99 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -96,6 +96,7 @@  ISADevice *isa_vga_init(ISABus *bus);
 
 /*  isa_get_irq() is deprecated, please use isa_bus_get_irq() instead. */
 qemu_irq isa_get_irq(ISADevice *dev, unsigned irqnum);
+ISABus *isa_bus_from_device(ISADevice *dev);
 
 /**
  * isa_register_ioport: Install an I/O port region on the ISA bus.
@@ -133,9 +134,4 @@  int isa_register_portio_list(ISADevice *dev,
                              const MemoryRegionPortio *portio,
                              void *opaque, const char *name);
 
-static inline ISABus *isa_bus_from_device(ISADevice *d)
-{
-    return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
-}
-
 #endif