lkml.org 
[lkml]   [2022]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] random: cleanup fractional entropy shift constants
Date
From: Jason A. Donenfeld
> Sent: 14 January 2022 15:33
>
> The entropy estimator is calculated in terms of 1/8 bits, which means
> there are various constants where things are shifted by 3. Move these
> into our pool info enum with the other relevant constants, and normalize
> the name a bit, prepending a POOL_ like the rest. While we're at it,
> move an English assertion about sizes into a proper BUILD_BUG_ON so
> that the compiler can ensure this invariant.
>
...
> -#define ENTROPY_SHIFT 3
> -#define ENTROPY_BITS() (input_pool.entropy_count >> ENTROPY_SHIFT)
..
> + POOL_ENTROPY_SHIFT = 3,
> +#define POOL_ENTROPY_BITS() (input_pool.entropy_count >> POOL_ENTROPY_SHIFT)

The rename ought to be a different patch.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2022-01-14 16:39    [W:0.132 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site