Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: num: bounded: add missing comment for always inlined function

This code is always inlined to avoid a build error if the error path of
`build_assert` cannot be optimized out. Add a comment justifying the
`#[inline(always)]` property to avoid it being taken away by mistake.

Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://patch.msgid.link/20251208-io-build-assert-v3-7-98aded02c1ea@nvidia.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Alexandre Courbot and committed by
Miguel Ojeda
2af6ad09 d6ff6e87

+1
+1
rust/kernel/num/bounded.rs
··· 367 367 /// assert_eq!(Bounded::<u8, 1>::from_expr(1).get(), 1); 368 368 /// assert_eq!(Bounded::<u16, 8>::from_expr(0xff).get(), 0xff); 369 369 /// ``` 370 + // Always inline to optimize out error path of `build_assert`. 370 371 #[inline(always)] 371 372 pub fn from_expr(expr: T) -> Self { 372 373 crate::build_assert!(