linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [2.6.22] powerpc: uninline and export virq_to_hw()
@ 2007-06-04  4:47 Olof Johansson
  2007-06-04  5:20 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Olof Johansson @ 2007-06-04  4:47 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

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.


Signed-off-by: Olof Johansson <olof@lixom.net>

diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 068377a..0df86cc 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -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,
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index 4734cc1..05dd5a3 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] [2.6.22] powerpc: uninline and export virq_to_hw()
  2007-06-04  4:47 [PATCH] [2.6.22] powerpc: uninline and export virq_to_hw() Olof Johansson
@ 2007-06-04  5:20 ` Benjamin Herrenschmidt
  2007-06-04  5:27   ` Olof Johansson
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2007-06-04  5:20 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, paulus

On Sun, 2007-06-03 at 23:47 -0500, Olof Johansson wrote:
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [2.6.22] powerpc: uninline and export virq_to_hw()
  2007-06-04  5:20 ` Benjamin Herrenschmidt
@ 2007-06-04  5:27   ` Olof Johansson
  2007-06-04  5:27     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Olof Johansson @ 2007-06-04  5:27 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, paulus

On Mon, Jun 04, 2007 at 03:20:10PM +1000, Benjamin Herrenschmidt wrote:
> On Sun, 2007-06-03 at 23:47 -0500, Olof Johansson wrote:
> > 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [2.6.22] powerpc: uninline and export virq_to_hw()
  2007-06-04  5:27   ` Olof Johansson
@ 2007-06-04  5:27     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2007-06-04  5:27 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, paulus

On Mon, 2007-06-04 at 00:27 -0500, Olof Johansson wrote:
> 
> > 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-04  5:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-04  4:47 [PATCH] [2.6.22] powerpc: uninline and export virq_to_hw() Olof Johansson
2007-06-04  5:20 ` Benjamin Herrenschmidt
2007-06-04  5:27   ` Olof Johansson
2007-06-04  5:27     ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).