]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sparseirq: move set/get_timer_rand_state back to .c
authorYinghai Lu <yinghai@kernel.org>
Sat, 3 Jan 2009 08:06:34 +0000 (00:06 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 3 Jan 2009 20:01:23 +0000 (12:01 -0800)
those two functions only used in that C file

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/random.c
include/linux/random.h

index d26891bfcd4154effba426421322ed053acb9d9b..c7afc068c28dcf6a64306754953682b0f9cfb70e 100644 (file)
@@ -559,7 +559,40 @@ struct timer_rand_state {
 };
 
 #ifndef CONFIG_SPARSE_IRQ
-struct timer_rand_state *irq_timer_state[NR_IRQS];
+
+static struct timer_rand_state *irq_timer_state[NR_IRQS];
+
+static struct timer_rand_state *get_timer_rand_state(unsigned int irq)
+{
+       return irq_timer_state[irq];
+}
+
+static void set_timer_rand_state(unsigned int irq,
+                                struct timer_rand_state *state)
+{
+       irq_timer_state[irq] = state;
+}
+
+#else
+
+static struct timer_rand_state *get_timer_rand_state(unsigned int irq)
+{
+       struct irq_desc *desc;
+
+       desc = irq_to_desc(irq);
+
+       return desc->timer_rand_state;
+}
+
+static void set_timer_rand_state(unsigned int irq,
+                                struct timer_rand_state *state)
+{
+       struct irq_desc *desc;
+
+       desc = irq_to_desc(irq);
+
+       desc->timer_rand_state = state;
+}
 #endif
 
 static struct timer_rand_state input_timer_state;
@@ -919,11 +952,6 @@ void rand_initialize_irq(int irq)
 {
        struct timer_rand_state *state;
 
-#ifndef CONFIG_SPARSE_IRQ
-       if (irq >= nr_irqs)
-               return;
-#endif
-
        state = get_timer_rand_state(irq);
 
        if (state)
index adbf3bd3c6b3c8edea3e313a4abce0a736d02ebf..407ea3646f8f12f05a0410166f3ff2e6fa4a447e 100644 (file)
@@ -45,56 +45,6 @@ struct rand_pool_info {
 
 extern void rand_initialize_irq(int irq);
 
-struct timer_rand_state;
-#ifndef CONFIG_SPARSE_IRQ
-
-extern struct timer_rand_state *irq_timer_state[];
-
-static inline struct timer_rand_state *get_timer_rand_state(unsigned int irq)
-{
-       if (irq >= nr_irqs)
-               return NULL;
-
-       return irq_timer_state[irq];
-}
-
-static inline void set_timer_rand_state(unsigned int irq, struct timer_rand_state *state)
-{
-       if (irq >= nr_irqs)
-               return;
-
-       irq_timer_state[irq] = state;
-}
-
-#else
-
-#include <linux/irq.h>
-static inline struct timer_rand_state *get_timer_rand_state(unsigned int irq)
-{
-       struct irq_desc *desc;
-
-       desc = irq_to_desc(irq);
-
-       if (!desc)
-               return NULL;
-
-       return desc->timer_rand_state;
-}
-
-static inline void set_timer_rand_state(unsigned int irq, struct timer_rand_state *state)
-{
-       struct irq_desc *desc;
-
-       desc = irq_to_desc(irq);
-
-       if (!desc)
-               return;
-
-       desc->timer_rand_state = state;
-}
-#endif
-
-
 extern void add_input_randomness(unsigned int type, unsigned int code,
                                 unsigned int value);
 extern void add_interrupt_randomness(int irq);