powerpc: Remove all usages of NO_IRQ
NO_IRQ has been == 0 on powerpc for just over ten years (since commit
0ebfff1491
("[POWERPC] Add new interrupt mapping core and change
platforms to use it")). It's also 0 on most other arches.
Although it's fairly harmless, every now and then it causes confusion
when a driver is built on powerpc and another arch which doesn't define
NO_IRQ. There's at least 6 definitions of NO_IRQ in drivers/, at least
some of which are to work around that problem.
So we'd like to remove it. This is fairly trivial in the arch code, we
just convert:
if (irq == NO_IRQ) to if (!irq)
if (irq != NO_IRQ) to if (irq)
irq = NO_IRQ; to irq = 0;
return NO_IRQ; to return 0;
And a few other odd cases as well.
At least for now we keep the #define NO_IRQ, because there is driver
code that uses NO_IRQ and the fixes to remove those will go via other
trees.
Note we also change some occurrences in PPC sound drivers, drivers/ps3,
and drivers/macintosh.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
@@ -192,7 +192,7 @@ static int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
|
||||
|
||||
*virq = irq_create_mapping(NULL, outlet);
|
||||
|
||||
if (*virq == NO_IRQ) {
|
||||
if (!*virq) {
|
||||
FAIL("%s:%d: irq_create_mapping failed: outlet %lu\n",
|
||||
__func__, __LINE__, outlet);
|
||||
result = -ENOMEM;
|
||||
@@ -339,7 +339,7 @@ int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq)
|
||||
if (result) {
|
||||
FAIL("%s:%d: lv1_construct_event_receive_port failed: %s\n",
|
||||
__func__, __LINE__, ps3_result(result));
|
||||
*virq = NO_IRQ;
|
||||
*virq = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ int ps3_sb_event_receive_port_setup(struct ps3_system_bus_device *dev,
|
||||
" failed: %s\n", __func__, __LINE__,
|
||||
ps3_result(result));
|
||||
ps3_event_receive_port_destroy(*virq);
|
||||
*virq = NO_IRQ;
|
||||
*virq = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -724,12 +724,12 @@ static unsigned int ps3_get_irq(void)
|
||||
asm volatile("cntlzd %0,%1" : "=r" (plug) : "r" (x));
|
||||
plug &= 0x3f;
|
||||
|
||||
if (unlikely(plug == NO_IRQ)) {
|
||||
if (unlikely(!plug)) {
|
||||
DBG("%s:%d: no plug found: thread_id %llu\n", __func__,
|
||||
__LINE__, pd->thread_id);
|
||||
dump_bmp(&per_cpu(ps3_private, 0));
|
||||
dump_bmp(&per_cpu(ps3_private, 1));
|
||||
return NO_IRQ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
|
@@ -91,7 +91,7 @@ static void __init ps3_smp_probe(void)
|
||||
result = smp_request_message_ipi(virqs[i], i);
|
||||
|
||||
if (result)
|
||||
virqs[i] = NO_IRQ;
|
||||
virqs[i] = 0;
|
||||
else
|
||||
ps3_register_ipi_irq(cpu, virqs[i]);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void ps3_smp_cleanup_cpu(int cpu)
|
||||
for (i = 0; i < MSG_COUNT; i++) {
|
||||
/* Can't call free_irq from interrupt context. */
|
||||
ps3_event_receive_port_destroy(virqs[i]);
|
||||
virqs[i] = NO_IRQ;
|
||||
virqs[i] = 0;
|
||||
}
|
||||
|
||||
DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu);
|
||||
|
@@ -284,7 +284,7 @@ fail_alloc_2:
|
||||
fail_alloc_1:
|
||||
ps3_spe_irq_destroy(spu->irqs[0]);
|
||||
fail_alloc_0:
|
||||
spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ;
|
||||
spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ static int ps3_destroy_spu(struct spu *spu)
|
||||
ps3_spe_irq_destroy(spu->irqs[1]);
|
||||
ps3_spe_irq_destroy(spu->irqs[0]);
|
||||
|
||||
spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ;
|
||||
spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = 0;
|
||||
|
||||
spu_unmap(spu);
|
||||
|
||||
|
Reference in New Issue
Block a user