]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rust: list: add macro for implementing ListItem
authorAlice Ryhl <aliceryhl@google.com>
Wed, 14 Aug 2024 08:05:24 +0000 (08:05 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Fri, 23 Aug 2024 04:26:57 +0000 (06:26 +0200)
commit40c53294596b4a7fe2ae126d7aab986752496c31
tree35c7d99b6e6496841a9246928aa21a28f1e49eca
parent14176295fe56ce9506e650dce436d2bdadec93b5
rust: list: add macro for implementing ListItem

Adds a macro for safely implementing the ListItem trait. As part of the
implementation of the macro, we also provide a HasListLinks trait
similar to the workqueue's HasWorkItem trait.

The HasListLinks trait is only necessary if you are implementing
ListItem using the impl_list_item macro.

Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20240814-linked-list-v5-5-f5f5e8075da0@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/list.rs
rust/kernel/list/impl_list_item_mod.rs [new file with mode: 0644]