Skip to contentSkip to conversation

Make irq_dispose_mapping(NO_IRQ) a nop

PATCH In review Michael Ellerman 2 participants 2 messages Oct 24, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make irq_dispose_mapping(NO_IRQ) a nop

It makes for a friendlier API if irq_dispose_mapping(NO_IRQ) is a nop, rather than triggering a WARN_ON.

---

 arch/powerpc/kernel/irq.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/powerpc/kernel/irq.c +5 -1
Index: git/arch/powerpc/kernel/irq.c
===================================================================
@@ -626,10 +626,14 @@ EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
 
 void irq_dispose_mapping(unsigned int virq)
 {
-	struct irq_host *host = irq_map[virq].host;
+	struct irq_host *host;
 	irq_hw_number_t hwirq;
 	unsigned long flags;
 
+	if (virq == NO_IRQ)
+		return;
+
+	host = irq_map[virq].host;
 	WARN_ON (host == NULL);
 	if (host == NULL)
 		return;
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Michael Ellerman

It makes for a friendlier API if irq_dispose_mapping(NO_IRQ) is a nop, rather than triggering a WARN_ON.

Quoted 25 lines

---

 arch/powerpc/kernel/irq.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: git/arch/powerpc/kernel/irq.c
===================================================================

arch/powerpc/kernel/irq.c +5 -1
@@ -626,10 +626,14 @@ EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
 
 void irq_dispose_mapping(unsigned int virq)
 {
-	struct irq_host *host = irq_map[virq].host;
+	struct irq_host *host;
 	irq_hw_number_t hwirq;
 	unsigned long flags;
 
+	if (virq == NO_IRQ)
+		return;
+
+	host = irq_map[virq].host;
 	WARN_ON (host == NULL);
 	if (host == NULL)
 		return;