Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
#include <linux/irq.h>
#include <linux/syscalls.h>
#include <linux/completion.h>
#include <linux/freezer.h>

#include <asm/processor.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -824,16 +825,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
void add_input_randomness(unsigned int type, unsigned int code,
unsigned int value)
{
static unsigned char last_value;

/* ignore autorepeat and the like */
if (value == last_value)
return;

last_value = value;
add_timer_randomness(&input_timer_state,
(type << 4) ^ code ^ (code >> 4) ^ value);
trace_add_input_randomness(ENTROPY_BITS(&input_pool));
return;
}
EXPORT_SYMBOL_GPL(add_input_randomness);

Expand Down Expand Up @@ -1362,7 +1354,7 @@ _random_read(int nonblock, char __user *buf, size_t nbytes)
if (nonblock)
return -EAGAIN;

wait_event_interruptible(random_read_wait,
wait_event_freezable(random_read_wait,
ENTROPY_BITS(&input_pool) >=
random_read_wakeup_bits);
if (signal_pending(current))
Expand Down