diff options
author | Paul Mundt <lethal@linux-sh.org> | 2012-01-24 09:41:55 +0100 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-01-24 09:41:55 +0100 |
commit | b59f9f9775e643435bba76e30e59e47c19c56dee (patch) | |
tree | 55bc067e5d2da0fc01ef9808ded60d9234dde165 /drivers/sh/intc/internals.h | |
parent | sh: intc: Use IRQ_SET_MASK_OK_NOCOPY for intc_set_affinity. (diff) | |
download | linux-b59f9f9775e643435bba76e30e59e47c19c56dee.tar.xz linux-b59f9f9775e643435bba76e30e59e47c19c56dee.zip |
sh: intc: optimize intc IRQ lookup
This ensures that the sense/prio lists are sorted at registration time,
enabling us to use a simple binary search for an optimized lookup
(something that had been on the TODO for some time).
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/sh/intc/internals.h')
-rw-r--r-- | drivers/sh/intc/internals.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h index 422b72df089e..f034a979a16f 100644 --- a/drivers/sh/intc/internals.h +++ b/drivers/sh/intc/internals.h @@ -108,6 +108,14 @@ static inline void activate_irq(int irq) #endif } +static inline int intc_handle_int_cmp(const void *a, const void *b) +{ + const struct intc_handle_int *_a = a; + const struct intc_handle_int *_b = b; + + return _a->irq - _b->irq; +} + /* access.c */ extern unsigned long (*intc_reg_fns[])(unsigned long addr, unsigned long h, unsigned long data); |