Subject: Re: [PATCH v3 2/3] prandom: Convert prandom_u32_state() to __always_inline

From: David Laight <[email-masked]>
Date: Fri, 2 Jan 2026 22:54:03 +0000

On Fri, 2 Jan 2026 14:39:21 +0100
"Jason A. Donenfeld" <[email-masked]> wrote:

> Hi Ryan,
...
> > +static __always_inline u32 prandom_u32_state(struct rnd_state *state)  
> 
> Why not just normal `inline`? Is gcc disagreeing with the inlinability
> of this function?

gcc has a mind of its own when it comes to inlining.
If there weren't some massive functions marked 'inline' that should never
really be inlined then making 'inline' '__always_inline' would make sense.
But first an audit would be needed.
(This has come up several times in the past.)
But if you need a function to be inlined (for any reason) it needs to be
always_inline.

Whether there should be an non-inlined 'option' here is another matter.
There could be a normal function that calls the inlined version.

	David

> Jason