From 8240ed29f033b7bc4e0c0ae5309f151d1df3c62a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 15 Oct 2008 14:31:29 +0200 Subject: [PATCH] --- yaml --- r: 116541 b: refs/heads/master c: c6b7674f323622d86316bf7951ad9cae1ce24642 h: refs/heads/master i: 116539: f555c4c6c79d888516cee6f2c5ce80bdf7c19433 v: v3 --- [refs] | 2 +- trunk/include/linux/irq.h | 15 +++++++++++++-- trunk/kernel/irq/handle.c | 14 -------------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 70b498626ba7..e0d0299c66cb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 70dd4d992ab324a59cdcd6bedc3f4e729863d514 +refs/heads/master: c6b7674f323622d86316bf7951ad9cae1ce24642 diff --git a/trunk/include/linux/irq.h b/trunk/include/linux/irq.h index dbe8734ae86c..7d1adacaadb4 100644 --- a/trunk/include/linux/irq.h +++ b/trunk/include/linux/irq.h @@ -204,8 +204,6 @@ struct irq_desc { const char *name; } ____cacheline_internodealigned_in_smp; -extern struct irq_desc *irq_to_desc(unsigned int irq); -extern struct irq_desc *irq_to_desc_alloc(unsigned int irq); #ifndef CONFIG_HAVE_SPARSE_IRQ @@ -216,8 +214,21 @@ extern struct irq_desc irq_desc[NR_IRQS]; extern struct irq_desc *irq_desc; #endif +static inline struct irq_desc *irq_to_desc(unsigned int irq) +{ + return (irq < nr_irqs) ? irq_desc + irq : NULL; +} + +static inline struct irq_desc *irq_to_desc_alloc(unsigned int irq) +{ + return irq_to_desc(irq); +} + #else +extern struct irq_desc *irq_to_desc(unsigned int irq); +extern struct irq_desc *irq_to_desc_alloc(unsigned int irq); + extern struct irq_desc *sparse_irqs; #define for_each_irq_desc(irqX, desc) \ for (desc = sparse_irqs, irqX = desc->irq; desc; desc = desc->next, irqX = desc ? desc->irq : -1U) diff --git a/trunk/kernel/irq/handle.c b/trunk/kernel/irq/handle.c index fb6bdb602a93..c19896f895f9 100644 --- a/trunk/kernel/irq/handle.c +++ b/trunk/kernel/irq/handle.c @@ -262,20 +262,6 @@ struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { #endif -#ifndef CONFIG_HAVE_SPARSE_IRQ -struct irq_desc *irq_to_desc(unsigned int irq) -{ - if (irq < nr_irqs) - return &irq_desc[irq]; - - return NULL; -} -struct irq_desc *irq_to_desc_alloc(unsigned int irq) -{ - return irq_to_desc(irq); -} -#endif - /* * What should we do if we get a hw irq event on an illegal vector? * Each architecture has to answer this themself.