From: Greg Price <price@MIT.EDU>
To: "Theodore Ts'o" <tytso@MIT.EDU>
Cc: linux-kernel@vger.kernel.org
Subject: [3.13 PATCH 1/2] random: entropy_bytes is actually bits
Date: Fri, 6 Dec 2013 21:27:52 -0500 [thread overview]
Message-ID: <20131207022751.GY16018@ringworld.MIT.EDU> (raw)
In-Reply-To: <cover.1386382885.git.price@mit.edu>
The variable 'entropy_bytes' is set from an expression that actually
counts bits. Fortunately it's also only compared to values that also
count bits. Rename it accordingly.
Signed-off-by: Greg Price <price@mit.edu>
---
drivers/char/random.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 429b75bb6..dc9b9af20 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -666,10 +666,10 @@ retry:
r->entropy_total, _RET_IP_);
if (r == &input_pool) {
- int entropy_bytes = entropy_count >> ENTROPY_SHIFT;
+ int entropy_bits = entropy_count >> ENTROPY_SHIFT;
/* should we wake readers? */
- if (entropy_bytes >= random_read_wakeup_thresh) {
+ if (entropy_bits >= random_read_wakeup_thresh) {
wake_up_interruptible(&random_read_wait);
kill_fasync(&fasync, SIGIO, POLL_IN);
}
@@ -678,7 +678,7 @@ retry:
* forth between them, until the output pools are 75%
* full.
*/
- if (entropy_bytes > random_write_wakeup_thresh &&
+ if (entropy_bits > random_write_wakeup_thresh &&
r->initialized &&
r->entropy_total >= 2*random_read_wakeup_thresh) {
static struct entropy_store *last = &blocking_pool;
--
1.8.3.2
next prev parent reply other threads:[~2013-12-07 2:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-07 2:27 [3.13 PATCH 0/2] random: bytes vs. bits Greg Price
2013-12-07 2:27 ` Greg Price [this message]
2013-12-07 14:50 ` [3.13 PATCH 1/2] random: entropy_bytes is actually bits Theodore Ts'o
2013-12-07 2:28 ` [PATCH 2/2] random: clarify bits/bytes in wakeup thresholds Greg Price
2013-12-07 19:20 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131207022751.GY16018@ringworld.MIT.EDU \
--to=price@mit.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@MIT.EDU \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox