Skip to contentSkip to conversation

Improve comment of get_random_bytes function

PATCH In review William Zijl 2 participants 2 messages Oct 1, 2022 Random number driver

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Improve comment of get_random_bytes function

Hi all,

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. Replace those sentences with the randomness returned by this function, at any point prior to this respectively.

Thanks,
Gusted

---
 drivers/char/random.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/char/random.c +5 -5
index fdf15f5c87dd..dd976008136b 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 returned
+ * by 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 8 lines · William Zijl

Hi all,

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. Replace those sentences with the randomness returned by this function, at any point prior to this respectively.

Thanks. As mentioned, "at any point prior" seems fine to me, so I kept that as-is, but committed the rest, and rewrote the commit message.

https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git/commit/?id=d687772e6d2cbffd91fdda64812f79192c1e7ca0

Jason