random32: Various minor cleanups
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest7 patches 23 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | lib/random32.c: Mark self-test data as __initconstlib/ | +2 | 1 reply | |
| 2/7 | lib/random32.c: Remove excess calls to prandom_u32_state in initializationlib/ | +8 | 2 replies | |
| 3/7 | lib/random32.c: Replace an #ifdef with a stub prandom_state_selftest()lib/ | +2 | 2 replies | |
| 4/7 | lib/random32.c: Use <asm/unaligned.h> instead of hand-rolling itlib/ | +11 | 4 replies | |
| 5/7 | lib/random32.c: Make prandom_u32_max efficient for powers of 2include/ | +13 | 6 replies | |
| 6/7 | lib/random32.c: Randomize timeout to the millisecond, not the secondlib/ | +3 | 5 replies | |
| 7/7 | lib/random32.c: Remove redundant U suffixes on integerslib/ | +5 | 3 replies |
Reviews trailers per patch
1 of 7 patches has a Reviewed-by or Acked-by.
| Patch | Daniel Borkmann |
|---|---|
| 1/7 | A-b |
| 2/7 | |
| 3/7 | |
| 4/7 | |
| 5/7 | |
| 6/7 | |
| 7/7 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/7] random32: Various minor cleanups
I was looking for self-test code to emulate for lib/glob.c and, while canvassing other code with self-tests, found some code that made me itch, so I scratched it.
7 patches;
1/7: Mark the self-test data as __initconst
2/7: Remove excess calls to prandom_u32_state in initialization 3/7: Replace an #ifdef with a stub prandom_state_selftest() 4/7: Use <asm/unaligned.h> instead of hand-rolling it 5/7: Make prandom_u32_max efficient for powers of 2 6/7: Randomize timeout to the millisecond, not the second 7/7: Remove redundant U suffixes on integers
I have a big follow-on patch series to replace all the (many) instances of "prandom_u32() % x" in the kernel with prandom_u32_max(x), which is more efficient.
As of patch 5/7, "prandom_u32() & (x-1)" can also be replaced by "prandom_u32_max(x)", but that's optional.
Patch 6/7 is dubious, and I'd like comments. I just don't see a reason why integer granularity would be desirable.