[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230130005725.3517597-5-sdonthineni@nvidia.com>
Date: Sun, 29 Jan 2023 18:57:24 -0600
From: Shanker Donthineni <sdonthineni@...dia.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Marc Zyngier <maz@...nel.org>, Michael Walle <michael@...le.cc>
CC: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Hans de Goede <hdegoede@...hat.com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Shanker Donthineni <sdonthineni@...dia.com>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH 4/5] genirq: Use the common function irq_expand_nr_irqs()
When the !SPARSEIRQ code path is executed, the function
irq_expand_nr_irqs() returns -ENOMEM. However, the SPARSEIRQ
version of the function can be safely used in both cases, as
nr_irqs = MAX_SPARSE_IRQS = NR_IRQS.
Signed-off-by: Shanker Donthineni <sdonthineni@...dia.com>
---
kernel/irq/irqdesc.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index aacfb4826c5e..247a0718d028 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -144,6 +144,14 @@ static unsigned int irq_find_next_irq(unsigned int offset)
return find_next_bit(allocated_irqs, nr_irqs, offset);
}
+static int irq_expand_nr_irqs(unsigned int nr)
+{
+ if (nr > MAX_SPARSE_IRQS)
+ return -ENOMEM;
+ nr_irqs = nr;
+ return 0;
+}
+
#ifdef CONFIG_SPARSE_IRQ
static void irq_kobj_release(struct kobject *kobj);
@@ -528,14 +536,6 @@ static int alloc_descs(unsigned int start, unsigned int cnt, int node,
return -ENOMEM;
}
-static int irq_expand_nr_irqs(unsigned int nr)
-{
- if (nr > MAX_SPARSE_IRQS)
- return -ENOMEM;
- nr_irqs = nr;
- return 0;
-}
-
int __init early_irq_init(void)
{
int i, initcnt, node = first_online_node;
@@ -630,11 +630,6 @@ static inline int alloc_descs(unsigned int start, unsigned int cnt, int node,
return start;
}
-static int irq_expand_nr_irqs(unsigned int nr)
-{
- return -ENOMEM;
-}
-
void irq_mark_irq(unsigned int irq)
{
mutex_lock(&sparse_irq_lock);
--
2.25.1
Powered by blists - more mailing lists