All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 21/23] ia64: Provide and use a __irq_is_enabled() helper
@ 2011-03-25 20:52 Thomas Gleixner
  0 siblings, 0 replies; only message in thread
From: Thomas Gleixner @ 2011-03-25 20:52 UTC (permalink / raw)
  To: linux-ia64

Remove the last open coded access to irq_desc.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/ia64/kernel/irq.c    |    2 +-
 arch/ia64/sn/kernel/irq.c |    2 +-
 include/linux/irqdesc.h   |    7 +++++++
 3 files changed, 9 insertions(+), 2 deletions(-)

Index: linux-2.6-tip/arch/ia64/kernel/irq.c
=================================--- linux-2.6-tip.orig/arch/ia64/kernel/irq.c
+++ linux-2.6-tip/arch/ia64/kernel/irq.c
@@ -137,7 +137,7 @@ static void migrate_irqs(void)
 		struct irq_data *data = irq_desc_get_irq_data(desc);
 		struct irq_chip *chip = irq_data_get_irq_chip(data);
 
-		if (desc->status = IRQ_DISABLED)
+		if (!__irq_is_enabled(irq))
 			continue;
 
 		/*
Index: linux-2.6-tip/arch/ia64/sn/kernel/irq.c
=================================--- linux-2.6-tip.orig/arch/ia64/sn/kernel/irq.c
+++ linux-2.6-tip/arch/ia64/sn/kernel/irq.c
@@ -412,7 +412,7 @@ sn_call_force_intr_provider(struct sn_ir
 	pci_provider = sn_pci_provider[sn_irq_info->irq_bridge_type];
 
 	/* Don't force an interrupt if the irq has been disabled */
-	if (!(irq_desc[sn_irq_info->irq_irq].status & IRQ_DISABLED) &&
+	if (__irq_is_enabled(sn_irq_info->irq_irq) &&
 	    pci_provider && pci_provider->force_interrupt)
 		(*pci_provider->force_interrupt)(sn_irq_info);
 }
Index: linux-2.6-tip/include/linux/irqdesc.h
=================================--- linux-2.6-tip.orig/include/linux/irqdesc.h
+++ linux-2.6-tip/include/linux/irqdesc.h
@@ -231,4 +231,11 @@ __irq_set_preflow_handler(unsigned int i
 #endif
 #endif
 
+static inline bool __irq_is_enabled(unsigned int irq)
+{
+	struct irq_desc *desc = irq_to_desc(irq);
+
+	return desc && !desc->depth;
+}
+
 #endif



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-25 20:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-25 20:52 [patch 21/23] ia64: Provide and use a __irq_is_enabled() helper Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.