[RFC PATCH v2 117/137] irq: Delete the *_orphan() IRQ allocation variants

Alexander Graf <[email protected]>
Newsgroups org.nongnu.qemu-arm,org.nongnu.qemu-devel,org.nongnu.qemu-riscv
Message-ID <[email protected]>
Every caller has been converted to the parented form; drop the
transitional *_orphan() helpers.

AI-used-for: code (refactoring)
Signed-off-by: Alexander Graf <[email protected]>
---
 hw/core/irq.c         | 35 -----------------------------------
 include/hw/core/irq.h | 20 +-------------------
 2 files changed, 1 insertion(+), 54 deletions(-)

diff --git a/hw/core/irq.c b/hw/core/irq.c
index 1ae53a74d3..459ff467ff 100644
--- a/hw/core/irq.c
+++ b/hw/core/irq.c
@@ -68,34 +68,6 @@ void qemu_init_irqs(IRQState irq[], size_t count,
     }
 }
 
-qemu_irq *qemu_extend_irqs_orphan(qemu_irq *old, int n_old, qemu_irq_handler handler,
-                           void *opaque, int n)
-{
-    qemu_irq *s;
-    int i;
-
-    if (!old) {
-        n_old = 0;
-    }
-    s = old ? g_renew(qemu_irq, old, n + n_old) : g_new(qemu_irq, n);
-    for (i = n_old; i < n + n_old; i++) {
-        s[i] = qemu_allocate_irq_orphan(handler, opaque, i);
-    }
-    return s;
-}
-
-qemu_irq *qemu_allocate_irqs_orphan(qemu_irq_handler handler, void *opaque, int n)
-{
-    return qemu_extend_irqs_orphan(NULL, 0, handler, opaque, n);
-}
-
-qemu_irq qemu_allocate_irq_orphan(qemu_irq_handler handler, void *opaque, int n)
-{
-    IRQState *irq = IRQ(object_new(TYPE_IRQ));
-    init_irq_fields(irq, handler, opaque, n);
-    return irq;
-}
-
 qemu_irq qemu_allocate_irq(Object *owner, const char *name,
                            qemu_irq_handler handler, void *opaque, int n)
 {
@@ -153,13 +125,6 @@ static void qemu_notirq(void *opaque, int line, int level)
     qemu_set_irq(irq, !level);
 }
 
-qemu_irq qemu_irq_invert_orphan(qemu_irq irq)
-{
-    /* The default state for IRQs is low, so raise the output now.  */
-    qemu_irq_raise(irq);
-    return qemu_allocate_irq_orphan(qemu_notirq, irq, 0);
-}
-
 qemu_irq qemu_irq_invert(Object *owner, const char *name, qemu_irq irq)
 {
     /* The default state for IRQs is low, so raise the output now.  */
diff --git a/include/hw/core/irq.h b/include/hw/core/irq.h
index 5ccccd2697..89923cf4a8 100644
--- a/include/hw/core/irq.h
+++ b/include/hw/core/irq.h
@@ -74,19 +74,8 @@ void qemu_init_irq_child(Object *parent, const char *propname,
 void qemu_init_irqs(IRQState irq[], size_t count,
                     qemu_irq_handler handler, void *opaque);
 
-/* Returns an array of N IRQs. Each IRQ is assigned the argument handler and
- * opaque data.
- */
-qemu_irq *qemu_allocate_irqs_orphan(qemu_irq_handler handler, void *opaque, int n);
-
 /*
- * Allocates a single IRQ. The irq is assigned with a handler, an opaque
- * data and the interrupt number.
- */
-qemu_irq qemu_allocate_irq_orphan(qemu_irq_handler handler, void *opaque, int n);
-
-/*
- * Same as the *_orphan() variants above, but the new IRQ objects are
+ * Allocate IRQ objects with an explicit QOM parent.  The new objects are
  * parented under @owner with property name @name (or @name[*] for the
  * array/extend variants).  The reference is held by @owner; call
  * qemu_free_irq() to unparent and free.
@@ -99,17 +88,10 @@ qemu_irq *qemu_extend_irqs(Object *owner, const char *name,
                            qemu_irq *old, int n_old,
                            qemu_irq_handler handler, void *opaque, int n);
 
-/* Extends an Array of IRQs. Old IRQs have their handlers and opaque data
- * preserved. New IRQs are assigned the argument handler and opaque data.
- */
-qemu_irq *qemu_extend_irqs_orphan(qemu_irq *old, int n_old, qemu_irq_handler handler,
-                                void *opaque, int n);
-
 void qemu_free_irqs(qemu_irq *s, int n);
 void qemu_free_irq(qemu_irq irq);
 
 /* Returns a new IRQ with opposite polarity.  */
-qemu_irq qemu_irq_invert_orphan(qemu_irq irq);
 qemu_irq qemu_irq_invert(Object *owner, const char *name, qemu_irq irq);
 
 /* For internal use in qtest. */
-- 
2.47.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.