From 954ace52601856f0ab8e8b7d98edd9d95df8ed2e Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Wed, 2 Aug 2006 10:48:50 +1000 Subject: [PATCH] --- yaml --- r: 38159 b: refs/heads/master c: e12514650b167f48e952d50315fd492d01d42988 h: refs/heads/master i: 38157: 71f7bd20d52819aba9679817a17f51df248bf59c 38155: 2acd6f329c62728228fbf0b6b0b6de55d52ac465 38151: 32d2cc85ced60650ffdd9fdd65d95c2bc2237149 38143: 9a2a82de4f893ca8fa1cdb7a738c1917c9cdc9c2 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/irq.c | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index a3c5bed317d7..831281f6c321 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 94983cb7881dff760d724759105a6f67935b571d +refs/heads/master: e12514650b167f48e952d50315fd492d01d42988 diff --git a/trunk/arch/powerpc/kernel/irq.c b/trunk/arch/powerpc/kernel/irq.c index b4432332341f..c3f58f2f9f52 100644 --- a/trunk/arch/powerpc/kernel/irq.c +++ b/trunk/arch/powerpc/kernel/irq.c @@ -777,7 +777,6 @@ unsigned int irq_alloc_virt(struct irq_host *host, { unsigned long flags; unsigned int i, j, found = NO_IRQ; - unsigned int limit = irq_virq_count - count; if (count == 0 || count > (irq_virq_count - NUM_ISA_INTERRUPTS)) return NO_IRQ; @@ -794,14 +793,16 @@ unsigned int irq_alloc_virt(struct irq_host *host, /* Look for count consecutive numbers in the allocatable * (non-legacy) space */ - for (i = NUM_ISA_INTERRUPTS; i <= limit; ) { - for (j = i; j < (i + count); j++) - if (irq_map[j].host != NULL) { - i = j + 1; - continue; - } - found = i; - break; + for (i = NUM_ISA_INTERRUPTS, j = 0; i < irq_virq_count; i++) { + if (irq_map[i].host != NULL) + j = 0; + else + j++; + + if (j == count) { + found = i - count + 1; + break; + } } if (found == NO_IRQ) { spin_unlock_irqrestore(&irq_big_lock, flags);