Skip to contentSkip to conversation

Improve comment of get_random_bytes function

PATCH Superseded William Zijl 3 participants 3 messages Oct 1, 2022 Random number driver

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Improve comment of get_random_bytes function

The old comment of this function had a double whitespace and contained grammatical errors, such as: the randomness by this function, at least once at any point prior. This patch replaces those sentenced with the randomness of this function, at any point prior to this respectively.

---
 drivers/char/random.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/char/random.c +5 -5
index 64ee16ffb8b7..e0b1b31789a5 100644
@@ -382,11 +382,11 @@ static void _get_random_bytes(void *buf, size_t len)
 }
 
 /*
- * This function is the exported kernel interface.  It returns some
- * number of good random numbers, suitable for key generation, seeding
- * TCP sequence numbers, etc. In order to ensure that the randomness
- * by this function is okay, the function wait_for_random_bytes()
- * should be called and return 0 at least once at any point prior.
+ * This function is the exported kernel interface. It returns some number
+ * of good random numbers, suitable for key generation, seeding TCP
+ * sequence numbers, etc. In order to ensure that the randomness of this
+ * function is okay, the function wait_for_random_bytes() should be called
+ * and return 0 at least once at any point prior to this.
  */
 void get_random_bytes(void *buf, size_t len)
 {
Signature · 1 line
2.37.3
#1 lore raw
Quoted 5 lines · William Zijl

The old comment of this function had a double whitespace and contained grammatical errors, such as: the randomness by this function, at least once at any point prior. This patch replaces those sentenced with the randomness of this function, at any point prior to this respectively.

"at any point prior" seems fine to me.

"the randomness by this function" is wrong, but the correction for it should be "the randomness returned by this function".

Feel free to submit a v2.

Jason

#2 lore raw
In reply to William Zijl
Quoted 5 lines · William Zijl

The old comment of this function had a double whitespace and contained grammatical errors, such as: the randomness by this function, at least once at any point prior. This patch replaces those sentenced with the randomness of this function, at any point prior to this respectively.

s/This patch replaces/Replace/

Why? See Documentation/process/submitting-patches.rst.

Signature · 1 line
An old man doll... just what I always wanted! - Clara