lkml.org 
[lkml]   [2023]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/5] genirq: Use the common function irq_expand_nr_irqs()
Date
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@nvidia.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
\
 
 \ /
  Last update: 2023-03-27 00:01    [W:0.293 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site