Re: [PATCH] rust: num: Add inline annotation to Bounded methods

From: Gary Guo

Date: Mon Oct 19 2026 - 07:14:10 EST


On Mon Oct 19, 2026 at 11:57 AM BST, Link Mauve wrote:
> It was previously generating a ton of very short functions, such as
> <<kernel::num::bounded::Bounded<u32, 32>>::shr::<17, 15>> or
> <<kernel::num::bounded::Bounded<u16, 16>>::new::<16384>> on use.
>
> These are obviously better inlined, although I wasn’t completely sure
> between #[inline] and #[inline(always)], but the former worked fine in
> my setup so I went for it, we can always adjust it later.
>
> Signed-off-by: Link Mauve <linkmauve@xxxxxxxxxxxx>

Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>

> ---
> rust/kernel/num/bounded.rs | 9 +++++++++
> 1 file changed, 9 insertions(+)