Skip to contentSkip to conversation

[2.6.22] powerpc: uninline and export virq_to_hw()

PATCH In review Olof Johansson 2 participants 4 messages Jun 4, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 [2.6.22] powerpc: uninline and export virq_to_hw()

Uninline virq_to_hw and export it so modules can use it. The alternative would be to export the irq_map array instead, but it's an infrequently called function, and keeping the array unexported seems considerably cleaner.

arch/powerpc/kernel/irq.c +6 -0
index 068377a..0df86cc 100644
@@ -412,6 +412,12 @@ struct irq_map_entry irq_map[NR_IRQS];
 static unsigned int irq_virq_count = NR_IRQS;
 static struct irq_host *irq_default_host;
 
+irq_hw_number_t virq_to_hw(unsigned int virq)
+{
+	return irq_map[virq].hwirq;
+}
+EXPORT_SYMBOL_GPL(virq_to_hw);
+
 struct irq_host *irq_alloc_host(unsigned int revmap_type,
 				unsigned int revmap_arg,
 				struct irq_host_ops *ops,
include/asm-powerpc/irq.h +1 -4
index 4734cc1..05dd5a3 100644
@@ -138,10 +138,7 @@ struct irq_map_entry {
 
 extern struct irq_map_entry irq_map[NR_IRQS];
 
-static inline irq_hw_number_t virq_to_hw(unsigned int virq)
-{
-	return irq_map[virq].hwirq;
-}
+extern irq_hw_number_t virq_to_hw(unsigned int virq);
 
 /**
  * irq_alloc_host - Allocate a new irq_host data structure
#1 lore raw
Quoted 5 lines · Olof Johansson

Uninline virq_to_hw and export it so modules can use it. The alternative
would be to export the irq_map array instead, but it's an infrequently called function, and keeping the array unexported seems considerably cleaner.

It's called in fairly hot IRQ code path (the PIC themselves use it) no ?

Ben.

#2 lore raw
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 5 lines · Olof Johansson

Uninline virq_to_hw and export it so modules can use it. The alternative
would be to export the irq_map array instead, but it's an infrequently called function, and keeping the array unexported seems considerably cleaner.

It's called in fairly hot IRQ code path (the PIC themselves use it) no ?

I looked before I did the change. All of those open-code it.

-Olof

#3 lore raw
Quoted 5 lines · Olof Johansson
Quoted 2 lines

It's called in fairly hot IRQ code path (the PIC themselves use it)

no ?

I looked before I did the change. All of those open-code it.

Ah ok :-) Yeah, well, I remember open coding it when I wrote the PIC code for virq's then somebody added virq_to_hw() :-)

Good to go then,

Cheers,
Ben.