]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: list: add `impl_list_item!` examples
authorTamir Duberstein <tamird@gmail.com>
Wed, 9 Jul 2025 19:31:15 +0000 (15:31 -0400)
committerMiguel Ojeda <ojeda@kernel.org>
Sat, 19 Jul 2025 21:18:18 +0000 (23:18 +0200)
commit5d840b4c4935cd5100be97b6df565b4b159970a5
treeeb33d9827e8c9f2043246af1849c2446215503d3
parent6a13057d500d48b1786344f4f93b0253adfc4e76
rust: list: add `impl_list_item!` examples

There's a comprehensive example in `rust/kernel/list.rs` but it doesn't
exercise the `using ListLinksSelfPtr` variant nor the generic cases. Add
that here. Generalize `impl_has_list_links_self_ptr` to handle nested
fields in the same manner as `impl_has_list_links`.

Tested-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Link: https://lore.kernel.org/r/20250709-list-no-offset-v4-5-a429e75840a9@gmail.com
[ Fixed Rust < 1.82 build by enabling the `offset_of_nested`
  feature. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/list/impl_list_item_mod.rs
scripts/Makefile.build