irqs: make irq_timer_state to use dyn_array
[deliverable/linux.git] / drivers / char / random.c
index 6af435b89867a7bb99689871624989dd8de14e61..1610aa64c7cf71f26f0eda5f508720b00eec92c4 100644 (file)
@@ -559,7 +559,13 @@ struct timer_rand_state {
 };
 
 static struct timer_rand_state input_timer_state;
+
+#ifdef CONFIG_HAVE_DYN_ARRAY
+static struct timer_rand_state **irq_timer_state;
+DEFINE_DYN_ARRAY(irq_timer_state, sizeof(struct timer_rand_state *), nr_irqs, PAGE_SIZE, NULL);
+#else
 static struct timer_rand_state *irq_timer_state[NR_IRQS];
+#endif
 
 /*
  * This function adds entropy to the entropy "pool" by using timing
@@ -648,7 +654,7 @@ EXPORT_SYMBOL_GPL(add_input_randomness);
 
 void add_interrupt_randomness(int irq)
 {
-       if (irq >= NR_IRQS || irq_timer_state[irq] == NULL)
+       if (irq >= nr_irqs || irq_timer_state[irq] == NULL)
                return;
 
        DEBUG_ENT("irq event %d\n", irq);
@@ -912,7 +918,7 @@ void rand_initialize_irq(int irq)
 {
        struct timer_rand_state *state;
 
-       if (irq >= NR_IRQS || irq_timer_state[irq])
+       if (irq >= nr_irqs || irq_timer_state[irq])
                return;
 
        /*
This page took 0.026032 seconds and 5 git commands to generate.