lkml.org 
[lkml]   [2022]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] random: add 8-bit and 16-bit batches
On Thu, Sep 29, 2022 at 1:33 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> There are numerous places in the kernel that would be sped up by having
> smaller batches. ...

> void get_random_bytes(void *buf, size_t len);
> +u8 get_random_u8(void);
> +u16 get_random_u16(void);
> u32 get_random_u32(void);
> u64 get_random_u64(void);
> static inline unsigned int get_random_int(void)

To me, the 32-bit & 64-bit functions look like an
obviously good idea. However, I cannot see
that the 8-bit or 16-bit functions are needed.

Even library functions like getchar() return an
int & whatever you return, it is going to be
handled as an int-sized item if it goes in a
register, so what's the point?

\
 
 \ /
  Last update: 2022-11-25 05:11    [W:1.978 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site