powerpc virq: new routine virq_to_hw
Ben,
Please consider this accessor routine which hides the details of the map.
---
include/asm-powerpc/irq.h +5 -0
@@ -136,6 +136,11 @@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; +}/** * irq_alloc_host - Allocate a new irq_host data structure
Quoted 13 lines · Geoff Levand
Ben,
Please consider this accessor routine which hides the details of the map.
Signed-off-by Geoff Levand <[email protected]>---
Index:cell--common--4/include/asm-powerpc/irq.h
===================================================================
include/asm-powerpc/irq.h line 143
Quoted 8 lines
include/asm-powerpc/irq.h +5
-0@@ -136,6 +136,11 @@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; +}
I'd much prefer:
static inline irq_hw_number_t virq_to_hw (unsigned int virq)
{
return irq_map[virq].hwirq;
}I've grown to dislike the CR between the return type and the function name (I used to do that too) and it seems that this opinion is shared by Linus (there was an old thread on lkml about it).
Cheers,
Ben.
Quoted 10 lines
I'd much prefer:
static inline
irq_hw_number_tvirq_to_hw(unsigned int virq){ return irq_map[virq].hwirq; }I've grown to dislike the CR between the return type and the function name (I used to do that too) and it seems that this opinion is shared by Linus (there was an old thread on lkml about it).
And while we're at it: no space before parenthesis in a function declaration/definition.
Segher
Quoted 6 lines · Benjamin Herrenschmidt
I'd much prefer:
static inline
irq_hw_number_tvirq_to_hw(unsigned int virq){ return irq_map[virq].hwirq; }
Here is an updated version.
-Geoff
This adds an accessor routine virq_to_hw() to the virq routines which hides the implementation details of the virq to hwirq map.
---
include/asm-powerpc/irq.h +4 -0
@@ -136,6 +136,10 @@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; +}/** * irq_alloc_host - Allocate a new irq_host data structure
Benjamin Herrenschmidt
Acked-byQuoted 13 lines · Geoff Levand
Quoted 6 lines · Benjamin Herrenschmidt
I'd much prefer:
static inline
irq_hw_number_tvirq_to_hw(unsigned int virq){ return irq_map[virq].hwirq; }Here is an updated version.
-Geoff
Quoted 6 lines
This adds an accessor routine
virq_to_hw()to the virq routines which hides the implementation details of the virq to hwirq map.Signed-off-by Geoff Levand <[email protected]>
Quoted 16 lines
---
Index:cell--common--4/include/asm-powerpc/irq.h
===================================================================include/asm-powerpc/irq.h +4
-0@@ -136,6 +136,10 @@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; +}/** * irq_alloc_host - Allocate a new irq_host data structure