Subject: Re: [PATCH 26/27] random: factor out a __limit_random_u32_below helper

From: "Jason A. Donenfeld" <[email-masked]>
Date: Thu, 12 Mar 2026 14:46:39 +0100

On Wed, Mar 11, 2026 at 08:03:58AM +0100, Christoph Hellwig wrote:
> Factor out the guts of __get_random_u32_below into a new helper,
> so that callers with their own prng state can reuse this code.

What Eric said. random.c is not "some library code" meant to be pulled
apart like this. If you think there are some good general purpose
arithmetic functions, by all means develop shared infrastructure in the
right place. But I think for this super simple/trivial _below function,
you can probably just place it additionally where you're using it,
without needing to touch random.c.