Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef24ba70 authored by Michael Ellerman's avatar Michael Ellerman
Browse files

powerpc: Remove all usages of NO_IRQ



NO_IRQ has been == 0 on powerpc for just over ten years (since commit
0ebfff14 ("[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: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 9d82fd2f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ struct machdep_calls {

	void		(*init_IRQ)(void);

	/* Return an irq, or NO_IRQ to indicate there are none pending. */
	/* Return an irq, or 0 to indicate there are none pending. */
	unsigned int	(*get_irq)(void);

	/* PCI stuff */
+3 −3
Original line number Diff line number Diff line
@@ -122,9 +122,9 @@ static inline void mpic_msgr_set_destination(struct mpic_msgr *msgr,
 * @msgr:	the message register whose IRQ is to be returned
 *
 * Returns the IRQ number associated with the given message register.
 * NO_IRQ is returned if this message register is not capable of
 * receiving interrupts.  What message register can and cannot receive
 * interrupts is specified in the device tree for the system.
 * 0 is returned if this message register is not capable of receiving
 * interrupts.  What message register can and cannot receive interrupts is
 * specified in the device tree for the system.
 */
static inline int mpic_msgr_get_irq(struct mpic_msgr *msgr)
{
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
		io1 = prop[1]; io2 = prop[2];

		virq = irq_of_parse_and_map(np, 0);
		if (virq == NO_IRQ)
		if (!virq)
			continue;

		if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0)
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ int ibmebus_request_irq(u32 ist, irq_handler_t handler,
{
	unsigned int irq = irq_create_mapping(NULL, ist);

	if (irq == NO_IRQ)
	if (!irq)
		return -EINVAL;

	return request_irq(irq, handler, irq_flags, devname, dev_id);
+1 −1
Original line number Diff line number Diff line
@@ -519,7 +519,7 @@ void __do_irq(struct pt_regs *regs)
	may_hard_irq_enable();

	/* And finally process it */
	if (unlikely(irq == NO_IRQ))
	if (unlikely(!irq))
		__this_cpu_inc(irq_stat.spurious_irqs);
	else
		generic_handle_irq(irq);
Loading