Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5857ccf authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

random: remove rand_initialize_irq()



With the new interrupt sampling system, we are no longer using the
timer_rand_state structure in the irq descriptor, so we can stop
initializing it now.

[ Merged in fixes from Sedat to find some last missing references to
  rand_initialize_irq() ]

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
parent 27130f0c
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -23,7 +23,6 @@
#include <linux/ioport.h>
#include <linux/ioport.h>
#include <linux/kernel_stat.h>
#include <linux/kernel_stat.h>
#include <linux/ptrace.h>
#include <linux/ptrace.h>
#include <linux/random.h>	/* for rand_initialize_irq() */
#include <linux/signal.h>
#include <linux/signal.h>
#include <linux/smp.h>
#include <linux/smp.h>
#include <linux/threads.h>
#include <linux/threads.h>
+0 −55
Original line number Original line Diff line number Diff line
@@ -634,43 +634,6 @@ struct timer_rand_state {
	unsigned dont_count_entropy:1;
	unsigned dont_count_entropy:1;
};
};


#ifndef CONFIG_GENERIC_HARDIRQS

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

/*
/*
 * Add device- or boot-specific data to the input and nonblocking
 * Add device- or boot-specific data to the input and nonblocking
 * pools to help initialize them to unique values.
 * pools to help initialize them to unique values.
@@ -1133,24 +1096,6 @@ static int rand_initialize(void)
}
}
module_init(rand_initialize);
module_init(rand_initialize);


void rand_initialize_irq(int irq)
{
	struct timer_rand_state *state;

	state = get_timer_rand_state(irq);

	if (state)
		return;

	/*
	 * If kzalloc returns null, we just won't use that entropy
	 * source.
	 */
	state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
	if (state)
		set_timer_rand_state(irq, state);
}

#ifdef CONFIG_BLOCK
#ifdef CONFIG_BLOCK
void rand_initialize_disk(struct gendisk *disk)
void rand_initialize_disk(struct gendisk *disk)
{
{
+0 −3
Original line number Original line Diff line number Diff line
@@ -931,9 +931,6 @@ static int __devinit ab3100_probe(struct i2c_client *client,


	err = request_threaded_irq(client->irq, NULL, ab3100_irq_handler,
	err = request_threaded_irq(client->irq, NULL, ab3100_irq_handler,
				IRQF_ONESHOT, "ab3100-core", ab3100);
				IRQF_ONESHOT, "ab3100-core", ab3100);
	/* This real unpredictable IRQ is of course sampled for entropy */
	rand_initialize_irq(client->irq);

	if (err)
	if (err)
		goto exit_no_irq;
		goto exit_no_irq;


+0 −1
Original line number Original line Diff line number Diff line
@@ -39,7 +39,6 @@ struct module;
 */
 */
struct irq_desc {
struct irq_desc {
	struct irq_data		irq_data;
	struct irq_data		irq_data;
	struct timer_rand_state *timer_rand_state;
	unsigned int __percpu	*kstat_irqs;
	unsigned int __percpu	*kstat_irqs;
	irq_flow_handler_t	handle_irq;
	irq_flow_handler_t	handle_irq;
#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
+0 −2
Original line number Original line Diff line number Diff line
@@ -48,8 +48,6 @@ struct rnd_state {


#ifdef __KERNEL__
#ifdef __KERNEL__


extern void rand_initialize_irq(int irq);

extern void add_device_randomness(const void *, unsigned int);
extern void add_device_randomness(const void *, unsigned int);
extern void add_input_randomness(unsigned int type, unsigned int code,
extern void add_input_randomness(unsigned int type, unsigned int code,
				 unsigned int value);
				 unsigned int value);
Loading