[ltt-dev] [PATCH] fix build error at CONFIG_SPARSE_IRQ=y
KOSAKI Motohiro
kosaki.motohiro at jp.fujitsu.com
Tue Feb 10 02:42:02 EST 2009
Impact: fix build error
When CONFIG_SPARSE_IRQ=y, There isn't irq_desc.
instead, for_each_irq_desc() is safe and recommend way.
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)
{
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);
}
}
#else
More information about the lttng-dev
mailing list