Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234763
b: refs/heads/master
c: ed4dea6
h: refs/heads/master
i:
  234761: 72742fa
  234759: 02cc1b6
v: v3
  • Loading branch information
Yinghai Lu authored and Thomas Gleixner committed Feb 21, 2011
1 parent d54f7d9 commit 7d39314
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a61d825808a0ce9935afebc225dcd602d5339e14
refs/heads/master: ed4dea6e0e33a3e58d8b77b775a8f0e433e7a005
15 changes: 8 additions & 7 deletions trunk/kernel/irq/irqdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ struct irq_desc * __ref irq_to_desc_alloc_node(unsigned int irq, int node)
return NULL;
}

static int irq_expand_nr_irqs(unsigned int cnt)
static int irq_expand_nr_irqs(unsigned int nr)
{
if (nr_irqs + cnt > IRQ_BITMAP_BITS)
if (nr > IRQ_BITMAP_BITS)
return -ENOMEM;
nr_irqs += cnt;
nr_irqs = nr;
return 0;
}

Expand Down Expand Up @@ -298,7 +298,7 @@ static inline int alloc_descs(unsigned int start, unsigned int cnt, int node)
return start;
}

static int irq_expand_nr_irqs(unsigned int cnt)
static int irq_expand_nr_irqs(unsigned int nr)
{
return -ENOMEM;
}
Expand Down Expand Up @@ -346,13 +346,14 @@ irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node)

mutex_lock(&sparse_irq_lock);

start = bitmap_find_next_zero_area(allocated_irqs, nr_irqs, from, cnt, 0);
start = bitmap_find_next_zero_area(allocated_irqs, IRQ_BITMAP_BITS,
from, cnt, 0);
ret = -EEXIST;
if (irq >=0 && start != irq)
goto err;

if (start >= nr_irqs) {
ret = irq_expand_nr_irqs(cnt);
if (start + cnt > nr_irqs) {
ret = irq_expand_nr_irqs(start + cnt);
if (ret)
goto err;
}
Expand Down

0 comments on commit 7d39314

Please sign in to comment.