Skip to contentSkip to conversation

random: remove dead code left over from blocking pool

PATCH Superseded Eric Biggers 2 participants 6 messages Sep 16, 2020 – Jan 4, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 random: remove dead code left over from blocking pool

From: Eric Biggers <[email protected]>

Remove some dead code that was left over following commit 90ea1c6436d2 ("random: remove the blocking pool").

---
 drivers/char/random.c         | 17 ++-----
 include/trace/events/random.h | 83 -----------------------------------
 2 files changed, 3 insertions(+), 97 deletions(-)
drivers/char/random.c +3 -14
index a8b9e66f41435..26f0a23a6f021 100644
@@ -500,7 +500,6 @@ struct entropy_store {
 	unsigned short add_ptr;
 	unsigned short input_rotate;
 	int entropy_count;
-	unsigned int initialized:1;
 	unsigned int last_data_init:1;
 	__u8 last_data[EXTRACT_SIZE];
 };
@@ -660,7 +659,7 @@ static void process_random_ready_list(void)
  */
 static void credit_entropy_bits(struct entropy_store *r, int nbits)
 {
-	int entropy_count, orig, has_initialized = 0;
+	int entropy_count, orig;
 	const int pool_size = r->poolinfo->poolfracbits;
 	int nfrac = nbits << ENTROPY_SHIFT;
 
@@ -717,23 +716,14 @@ static void credit_entropy_bits(struct entropy_store *r, int nbits)
 	if (cmpxchg(&r->entropy_count, orig, entropy_count) != orig)
 		goto retry;
 
-	if (has_initialized) {
-		r->initialized = 1;
-		kill_fasync(&fasync, SIGIO, POLL_IN);
-	}
-
 	trace_credit_entropy_bits(r->name, nbits,
 				  entropy_count >> ENTROPY_SHIFT, _RET_IP_);
 
 	if (r == &input_pool) {
 		int entropy_bits = entropy_count >> ENTROPY_SHIFT;
 
-		if (crng_init < 2) {
-			if (entropy_bits < 128)
-				return;
+		if (crng_init < 2 && entropy_bits >= 128)
 			crng_reseed(&primary_crng, r);
-			entropy_bits = ENTROPY_BITS(r);
-		}
 	}
 }
 
@@ -1386,8 +1376,7 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min,
 }
 
 /*
- * This function does the actual extraction for extract_entropy and
- * extract_entropy_user.
+ * This function does the actual extraction for extract_entropy.
  *
  * Note: we assume that .poolwords is a multiple of 16 words.
  */
include/trace/events/random.h +0 -83

101 lines not on this page · raw message

Signature · 1 line
2.28.0
#4 lore raw
Quoted 4 lines · Eric Biggers
Quoted 3 lines · Eric Biggers
Quoted 2 lines · Eric Biggers

From: Eric Biggers <[email protected]>

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Remove some dead code that was left over following commit 90ea1c6436d2 ("random: remove the blocking pool").

Ping?

Ping.

Ping.

#5 lore raw
Quoted 8 lines · Eric Biggers
Quoted 7 lines · Eric Biggers
Quoted 6 lines · Eric Biggers
Quoted 5 lines · Eric Biggers

From: Eric Biggers <[email protected]>

Remove some dead code that was left over following commit 90ea1c6436d2 ("random: remove the blocking pool").

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Ping?

Ping.

Ping.

Ping.