]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rust: list: Add an example for `ListLinksSelfPtr` usage
authorBoqun Feng <boqun.feng@gmail.com>
Thu, 24 Jul 2025 17:20:05 +0000 (10:20 -0700)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 14 Sep 2025 23:10:23 +0000 (01:10 +0200)
commitbf87a41b85d67695a04b422499b77748fe845945
tree1cb3704819d0548cb91a52bf1a645d651ec5ecf5
parenta15d12c24fa790533c8c133e84a8bf23777a7a43
rust: list: Add an example for `ListLinksSelfPtr` usage

It appears that the support for `ListLinksSelfPtr` is dead code at the
moment [1]. Although some tests were added at [2] for impl `ListItem`
using `ListLinksSelfPtr` field, still we could use more examples
demonstrating and testing the usage of `ListLinksSelfPtr`. Hence add an
example similar to `ListLinks` usage.

The example is mostly based on Alice's usage in binder driver [3].

Link: https://lore.kernel.org/rust-for-linux/20250719183649.596051-1-ojeda@kernel.org/
Link: https://lore.kernel.org/rust-for-linux/20250709-list-no-offset-v4-5-a429e75840a9@gmail.com/
Link: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-4-08ba9197f637@google.com/
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
[ Fixed typo. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/list.rs