Thread (26 messages) 26 messages, 5 authors, 2026-01-19

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

From: David Laight <hidden>
Date: 2026-01-02 22:54:07
Also in: linux-arm-kernel, linux-hardening, linux-riscv, linux-s390, lkml, loongarch

On Fri, 2 Jan 2026 14:39:21 +0100
"Jason A. Donenfeld" [off-list ref] wrote:
Hi Ryan,
...
quoted
+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
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help