[ltt-dev] [PATCH] fix build error at CONFIG_SPARSE_IRQ=y

Mathieu Desnoyers compudj at krystal.dyndns.org
Tue Feb 10 23:33:41 EST 2009


* KOSAKI Motohiro (kosaki.motohiro at jp.fujitsu.com) wrote:
> 
> Impact: fix build error
> 
> When CONFIG_SPARSE_IRQ=y, There isn't irq_desc.
>  instead, for_each_irq_desc() is safe and recommend way.
> 

Hi Kosaki,

> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro at jp.fujitsu.com>
> ---
> diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
> index deb5605..03cac54 100644
> --- a/kernel/irq/handle.c
> +++ b/kernel/irq/handle.c
> @@ -75,8 +75,6 @@ static void __init init_irq_default_affinity(void)
>  int nr_irqs = NR_IRQS;
>  EXPORT_SYMBOL_GPL(nr_irqs);
>  
> -EXPORT_SYMBOL(irq_desc);
> -
>  #ifdef CONFIG_SPARSE_IRQ
>  static struct irq_desc irq_desc_init = {
>  	.irq	    = -1,
> @@ -178,6 +176,7 @@ struct irq_desc *irq_to_desc(unsigned int irq)
>  {
>  	return (irq < NR_IRQS) ? irq_desc_ptrs[irq] : NULL;
>  }
> +EXPORT_SYMBOL(irq_to_desc);
>  
>  struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu)
>  {
> @@ -257,6 +256,7 @@ struct irq_desc *irq_to_desc(unsigned int irq)
>  {
>  	return (irq < NR_IRQS) ? irq_desc + irq : NULL;
>  }
> +EXPORT_SYMBOL(irq_to_desc);
>  
>  struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu)
>  {

Merged in next lttng-export-irq_desc.patch for 2.6.29-rc4. Thanks !

> diff --git a/ltt/ltt-statedump.c b/ltt/ltt-statedump.c


> index 0afc982..531c95b 100644
> --- a/ltt/ltt-statedump.c
> +++ b/ltt/ltt-statedump.c
> @@ -20,7 +20,7 @@
>  #include <linux/proc_fs.h>
>  #include <linux/file.h>
>  #include <linux/interrupt.h>
> -#include <linux/irq.h>
> +#include <linux/irqnr.h>
>  #include <linux/cpu.h>
>  #include <linux/netdevice.h>
>  #include <linux/inetdevice.h>
> @@ -29,7 +29,6 @@
>  #include <linux/marker.h>
>  #include <linux/fdtable.h>
>  #include <linux/swap.h>
> -#include <linux/irq.h>
>  
>  #define NB_PROC_CHUNK 20
>  
> @@ -223,22 +222,22 @@ ltt_enumerate_vm_maps(struct ltt_probe_private_data *call_data)
>  #ifdef CONFIG_GENERIC_HARDIRQS
>  static inline void list_interrupts(struct ltt_probe_private_data *call_data)
>  {
> -	unsigned int i;
> +	unsigned int irq;
>  	unsigned long flags = 0;
> +	struct irq_desc *desc;
>  
>  	/* needs irq_desc */
> -	for (i = 0; i < NR_IRQS; i++) {
> +	for_each_irq_desc(irq, desc) {
>  		struct irqaction *action;
> -		const char *irq_chip_name =
> -			irq_desc[i].chip->name ? : "unnamed_irq_chip";
> +		const char *irq_chip_name = desc->chip->name ? : "unnamed_irq_chip";
>  
> -		spin_lock_irqsave(&irq_desc[i].lock, flags);
> -		for (action = irq_desc[i].action;
> +		spin_lock_irqsave(&desc->lock, flags);
> +		for (action = desc->action;
>  				action; action = action->next)
>  			__trace_mark(0, irq_state, interrupt, call_data,
>  				"name %s action %s irq_id %u",
> -				irq_chip_name, action->name, i);
> -		spin_unlock_irqrestore(&irq_desc[i].lock, flags);
> +				irq_chip_name, action->name, irq);
> +		spin_unlock_irqrestore(&desc->lock, flags);

Merged by hand in lttng-statedump.patch (conflicted with local changes),
thanks !

Mathieu

>  	}
>  }
>  #else
> 
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 


-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68




More information about the lttng-dev mailing list