Re: [PATCH] sparc: Provide NO_IRQ definition.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 18, 2011 at 03:04:35PM -0700, David Miller wrote:
> 
> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
> ---
>  arch/sparc/include/asm/irq_32.h |    3 +++
>  arch/sparc/include/asm/irq_64.h |    2 ++
>  2 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/sparc/include/asm/irq_32.h b/arch/sparc/include/asm/irq_32.h
> index cbf4801..eced3e3 100644
> --- a/arch/sparc/include/asm/irq_32.h
> +++ b/arch/sparc/include/asm/irq_32.h
> @@ -13,4 +13,7 @@
>  #define irq_canonicalize(irq)	(irq)
>  
>  extern void __init init_IRQ(void);
> +
> +#define NO_IRQ		0xffffffff
> +
>  #endif
> diff --git a/arch/sparc/include/asm/irq_64.h b/arch/sparc/include/asm/irq_64.h
> index 4f09666f..16dcae6d 100644
> --- a/arch/sparc/include/asm/irq_64.h
> +++ b/arch/sparc/include/asm/irq_64.h
> @@ -97,4 +97,6 @@ extern void *softirq_stack[NR_CPUS];
>  #define __ARCH_HAS_DO_SOFTIRQ
>  #define ARCH_HAS_NMI_WATCHDOG
>  
> +#define NO_IRQ		0xffffffff
> +
>  #endif

Why -1 (0xffffffff)?

drivers/of/irq.c default to 0 - like this:
/* For archs that don't support NO_IRQ (such as x86), provide a dummy value */
#ifndef NO_IRQ
#define NO_IRQ 0
#endif

I can see that the actual value differs from arch to arch.

I recalled a discussion about this topic some years ago.
Do not ask how I managed to do so?!?

Anyway the input from Linus was to use 0 for NO_IRQ because
as he said:

====
But the point is that most drivers will do something like

	if (!dev->irq)
		return;
(whatever, made up). And that having NO_IRQ be anything but 0 is thus 
fundamentally broken.
====

See the full mail here:

    http://lkml.org/lkml/2005/11/21/211


I do not know of any places that would break - I just
wanted to bring this to your attention.

	Sam
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux