From 40c53294596b4a7fe2ae126d7aab986752496c31 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Wed, 14 Aug 2024 08:05:24 +0000 Subject: 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 Signed-off-by: Alice Ryhl Link: https://lore.kernel.org/r/20240814-linked-list-v5-5-f5f5e8075da0@google.com Signed-off-by: Miguel Ojeda --- rust/kernel/list.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rust/kernel/list.rs') diff --git a/rust/kernel/list.rs b/rust/kernel/list.rs index 074ae863ff5a..670d53989b8f 100644 --- a/rust/kernel/list.rs +++ b/rust/kernel/list.rs @@ -8,6 +8,9 @@ use crate::init::PinInit; use crate::types::Opaque; use core::ptr; +mod impl_list_item_mod; +pub use self::impl_list_item_mod::{impl_has_list_links, impl_list_item, HasListLinks}; + mod arc; pub use self::arc::{impl_list_arc_safe, AtomicTracker, ListArc, ListArcSafe, TryNewListArc}; -- cgit v1.2.3-58-ga151