[PATCH v4 2/7] rust: bitfield: inline private accessors
From: Alexandre Courbot
Date: Wed May 27 2026 - 09:02:56 EST
All bitfield methods are inline, except these two ones. This is an
oversight, so inline them.
Reported-by: Gary Guo <gary@xxxxxxxxxxx>
Closes: https://lore.kernel.org/all/DIFZRBF3LYHN.19Z6RBMECXDVM@xxxxxxxxxxx/
Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
---
rust/kernel/bitfield.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/rust/kernel/bitfield.rs b/rust/kernel/bitfield.rs
index 4083e7b7a307..b3ad5fdbfb23 100644
--- a/rust/kernel/bitfield.rs
+++ b/rust/kernel/bitfield.rs
@@ -385,6 +385,7 @@ impl $name {
);
::kernel::macros::paste!(
+ #[inline(always)]
fn [<__ $field>](self) ->
::kernel::num::Bounded<$storage, { $hi + 1 - $lo }> {
// Left shift to align the field's MSB with the storage MSB.
@@ -400,6 +401,7 @@ fn [<__ $field>](self) ->
val.shr::<ALIGN_BOTTOM, { $hi + 1 - $lo } >()
}
+ #[inline(always)]
const fn [<__with_ $field>](
mut self,
value: ::kernel::num::Bounded<$storage, { $hi + 1 - $lo }>,
--
2.54.0