Messages in this thread Patch in this message |  | | From | Shanker Donthineni <> | Subject | [PATCH 4/5] genirq: Use the common function irq_expand_nr_irqs() | Date | Sun, 29 Jan 2023 18:57:24 -0600 |
| |
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
|  |