diff --git a/rust/kernel/num/bounded.rs b/rust/kernel/num/bounded.rs index 18e45bf6f84b..92c41b2eb760 100644 --- a/rust/kernel/num/bounded.rs +++ b/rust/kernel/num/bounded.rs @@ -35,6 +35,7 @@ macro_rules! fits_within { } /// Returns `true` if `value` can be represented with at most `N` bits in a `T`. +#[inline(always)] fn fits_within(value: T, num_bits: u32) -> bool { fits_within!(value, T, num_bits) } @@ -362,6 +363,7 @@ pub fn try_new(value: T) -> Option { /// assert_eq!(Bounded::::from_expr(1).get(), 1); /// assert_eq!(Bounded::::from_expr(0xff).get(), 0xff); /// ``` + #[inline(always)] pub fn from_expr(expr: T) -> Self { crate::build_assert!( fits_within(expr, N),