public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] random32: Various minor cleanups
@ 2014-06-07  8:18 George Spelvin
  2014-06-07  8:19 ` [PATCH 1/7] lib/random32.c: Mark self-test data as __initconst George Spelvin
                   ` (6 more replies)
  0 siblings, 7 replies; 31+ messages in thread
From: George Spelvin @ 2014-06-07  8:18 UTC (permalink / raw)
  To: davem, dborkman, shemminger, tytso; +Cc: linux, linux-kernel

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.

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2014-06-10 15:13 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-07  8:18 [PATCH 0/7] random32: Various minor cleanups George Spelvin
2014-06-07  8:19 ` [PATCH 1/7] lib/random32.c: Mark self-test data as __initconst George Spelvin
2014-06-08 12:06   ` Daniel Borkmann
2014-06-07  8:20 ` [PATCH 2/7] lib/random32.c: Remove excess calls to prandom_u32_state in initialization George Spelvin
2014-06-08 12:11   ` Daniel Borkmann
2014-06-08 12:19     ` George Spelvin
2014-06-07  8:22 ` [PATCH 3/7] lib/random32.c: Replace an #ifdef with a stub prandom_state_selftest() George Spelvin
2014-06-08 12:16   ` Daniel Borkmann
2014-06-08 12:27     ` George Spelvin
2014-06-07  8:25 ` [PATCH 4/7] lib/random32.c: Use <asm/unaligned.h> instead of hand-rolling it George Spelvin
2014-06-08 12:25   ` Daniel Borkmann
2014-06-08 12:40     ` George Spelvin
2014-06-08 20:26       ` Hannes Frederic Sowa
2014-06-10 15:13       ` Daniel Borkmann
2014-06-07  8:28 ` [PATCH 5/7] lib/random32.c: Make prandom_u32_max efficient for powers of 2 George Spelvin
2014-06-08 12:03   ` Daniel Borkmann
2014-06-08 17:34   ` Hannes Frederic Sowa
2014-06-08 20:02     ` Daniel Borkmann
2014-06-09  0:28       ` George Spelvin
2014-06-08 20:48     ` George Spelvin
2014-06-09 10:30       ` Hannes Frederic Sowa
2014-06-07  8:28 ` [PATCH 6/7] lib/random32.c: Randomize timeout to the millisecond, not the second George Spelvin
2014-06-08 10:43   ` Daniel Borkmann
2014-06-08 11:30     ` George Spelvin
2014-06-08 12:28       ` Daniel Borkmann
2014-06-08 12:42         ` George Spelvin
2014-06-08 20:01           ` Daniel Borkmann
2014-06-07  8:31 ` [PATCH 7/7] lib/random32.c: Remove redundant U suffixes on integers George Spelvin
2014-06-08 10:36   ` Daniel Borkmann
2014-06-08 11:14     ` George Spelvin
2014-06-08 12:05       ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox